d3js v5 + topojson v3 Access to the object's properties in the background












0















I'm looking for a tip to access to the object's properties in the background.
Indeed, with a mousehover, I want to reveal the properties of layer ze.json (the geographical unit).



However, my proportionnal circles hide this layer.
enter image description here



I have not really idea of the procedure envisaged because :




  • Circle proportional must be on the top

  • Opacity doesn't solve the problem


Maybe I should report the information on proportional circles. But how could I transfer this information ? (not only the population but also the ZE name)



Proportionnal Circles



let rMax = d3.max(featureCollectionZe.features,(d)=>{return d.properties.pop;});

let propCircle = g.attr("class","prop_circle")
.selectAll(".prop_circle")
.data(featureCollectionZe.features)
.enter()
.append("circle")
.attr("transform", (d)=>{return "translate(" + path.centroid(d) + ")";})
.attr("r",(d)=>{return(Math.sqrt(d.properties.pop/rMax))*30;})
.attr("fill","#ffa500")
.attr("fill-opacity",0.8)
.attr("stroke-width",1)


Mouse event



svgZe
.on("mouseover",
(e)=>{return document.getElementById("name").innerHTML=e.properties.nom_ze,
document.getElementById("pop").innerHTML=e.properties.pop;}
)
.on("mouseout",
(e)=>{return document.getElementById("name").innerHTML="&nbsp",
document.getElementById("pop").innerHTML="&nbsp";}
)


Here is my code : https://plnkr.co/edit/ZzeHWfChXa348iNBcHWQ










share|improve this question























  • side notes: zoom can be shortened by g.attr("transform", d3.event.transform); , what is that purpose of the last .append("g"); , make the stroke of the .ze. more explicit in the style, it is now due to render artefacts that you see the edges

    – rioV8
    Nov 22 '18 at 21:10











  • Thank you for the tip! Indeed, .append("g") has no sense. I had a displacement problem when I click+move the map with the mouse (latency) but seems disappeared now.

    – Bellice
    Nov 23 '18 at 10:06
















0















I'm looking for a tip to access to the object's properties in the background.
Indeed, with a mousehover, I want to reveal the properties of layer ze.json (the geographical unit).



However, my proportionnal circles hide this layer.
enter image description here



I have not really idea of the procedure envisaged because :




  • Circle proportional must be on the top

  • Opacity doesn't solve the problem


Maybe I should report the information on proportional circles. But how could I transfer this information ? (not only the population but also the ZE name)



Proportionnal Circles



let rMax = d3.max(featureCollectionZe.features,(d)=>{return d.properties.pop;});

let propCircle = g.attr("class","prop_circle")
.selectAll(".prop_circle")
.data(featureCollectionZe.features)
.enter()
.append("circle")
.attr("transform", (d)=>{return "translate(" + path.centroid(d) + ")";})
.attr("r",(d)=>{return(Math.sqrt(d.properties.pop/rMax))*30;})
.attr("fill","#ffa500")
.attr("fill-opacity",0.8)
.attr("stroke-width",1)


Mouse event



svgZe
.on("mouseover",
(e)=>{return document.getElementById("name").innerHTML=e.properties.nom_ze,
document.getElementById("pop").innerHTML=e.properties.pop;}
)
.on("mouseout",
(e)=>{return document.getElementById("name").innerHTML="&nbsp",
document.getElementById("pop").innerHTML="&nbsp";}
)


Here is my code : https://plnkr.co/edit/ZzeHWfChXa348iNBcHWQ










share|improve this question























  • side notes: zoom can be shortened by g.attr("transform", d3.event.transform); , what is that purpose of the last .append("g"); , make the stroke of the .ze. more explicit in the style, it is now due to render artefacts that you see the edges

    – rioV8
    Nov 22 '18 at 21:10











  • Thank you for the tip! Indeed, .append("g") has no sense. I had a displacement problem when I click+move the map with the mouse (latency) but seems disappeared now.

    – Bellice
    Nov 23 '18 at 10:06














0












0








0








I'm looking for a tip to access to the object's properties in the background.
Indeed, with a mousehover, I want to reveal the properties of layer ze.json (the geographical unit).



However, my proportionnal circles hide this layer.
enter image description here



I have not really idea of the procedure envisaged because :




  • Circle proportional must be on the top

  • Opacity doesn't solve the problem


Maybe I should report the information on proportional circles. But how could I transfer this information ? (not only the population but also the ZE name)



Proportionnal Circles



let rMax = d3.max(featureCollectionZe.features,(d)=>{return d.properties.pop;});

let propCircle = g.attr("class","prop_circle")
.selectAll(".prop_circle")
.data(featureCollectionZe.features)
.enter()
.append("circle")
.attr("transform", (d)=>{return "translate(" + path.centroid(d) + ")";})
.attr("r",(d)=>{return(Math.sqrt(d.properties.pop/rMax))*30;})
.attr("fill","#ffa500")
.attr("fill-opacity",0.8)
.attr("stroke-width",1)


Mouse event



svgZe
.on("mouseover",
(e)=>{return document.getElementById("name").innerHTML=e.properties.nom_ze,
document.getElementById("pop").innerHTML=e.properties.pop;}
)
.on("mouseout",
(e)=>{return document.getElementById("name").innerHTML="&nbsp",
document.getElementById("pop").innerHTML="&nbsp";}
)


Here is my code : https://plnkr.co/edit/ZzeHWfChXa348iNBcHWQ










share|improve this question














I'm looking for a tip to access to the object's properties in the background.
Indeed, with a mousehover, I want to reveal the properties of layer ze.json (the geographical unit).



However, my proportionnal circles hide this layer.
enter image description here



I have not really idea of the procedure envisaged because :




  • Circle proportional must be on the top

  • Opacity doesn't solve the problem


Maybe I should report the information on proportional circles. But how could I transfer this information ? (not only the population but also the ZE name)



Proportionnal Circles



let rMax = d3.max(featureCollectionZe.features,(d)=>{return d.properties.pop;});

let propCircle = g.attr("class","prop_circle")
.selectAll(".prop_circle")
.data(featureCollectionZe.features)
.enter()
.append("circle")
.attr("transform", (d)=>{return "translate(" + path.centroid(d) + ")";})
.attr("r",(d)=>{return(Math.sqrt(d.properties.pop/rMax))*30;})
.attr("fill","#ffa500")
.attr("fill-opacity",0.8)
.attr("stroke-width",1)


Mouse event



svgZe
.on("mouseover",
(e)=>{return document.getElementById("name").innerHTML=e.properties.nom_ze,
document.getElementById("pop").innerHTML=e.properties.pop;}
)
.on("mouseout",
(e)=>{return document.getElementById("name").innerHTML="&nbsp",
document.getElementById("pop").innerHTML="&nbsp";}
)


Here is my code : https://plnkr.co/edit/ZzeHWfChXa348iNBcHWQ







javascript d3.js topojson






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 '18 at 17:20









BelliceBellice

1138




1138













  • side notes: zoom can be shortened by g.attr("transform", d3.event.transform); , what is that purpose of the last .append("g"); , make the stroke of the .ze. more explicit in the style, it is now due to render artefacts that you see the edges

    – rioV8
    Nov 22 '18 at 21:10











  • Thank you for the tip! Indeed, .append("g") has no sense. I had a displacement problem when I click+move the map with the mouse (latency) but seems disappeared now.

    – Bellice
    Nov 23 '18 at 10:06



















  • side notes: zoom can be shortened by g.attr("transform", d3.event.transform); , what is that purpose of the last .append("g"); , make the stroke of the .ze. more explicit in the style, it is now due to render artefacts that you see the edges

    – rioV8
    Nov 22 '18 at 21:10











  • Thank you for the tip! Indeed, .append("g") has no sense. I had a displacement problem when I click+move the map with the mouse (latency) but seems disappeared now.

    – Bellice
    Nov 23 '18 at 10:06

















side notes: zoom can be shortened by g.attr("transform", d3.event.transform); , what is that purpose of the last .append("g"); , make the stroke of the .ze. more explicit in the style, it is now due to render artefacts that you see the edges

– rioV8
Nov 22 '18 at 21:10





side notes: zoom can be shortened by g.attr("transform", d3.event.transform); , what is that purpose of the last .append("g"); , make the stroke of the .ze. more explicit in the style, it is now due to render artefacts that you see the edges

– rioV8
Nov 22 '18 at 21:10













Thank you for the tip! Indeed, .append("g") has no sense. I had a displacement problem when I click+move the map with the mouse (latency) but seems disappeared now.

– Bellice
Nov 23 '18 at 10:06





Thank you for the tip! Indeed, .append("g") has no sense. I had a displacement problem when I click+move the map with the mouse (latency) but seems disappeared now.

– Bellice
Nov 23 '18 at 10:06












1 Answer
1






active

oldest

votes


















1














I am not sure, that this solves your problem completely, but have you tried to apply pointer-events: none CSS property to circles?






share|improve this answer
























  • Indeed, it works. Thank you again!

    – Bellice
    Nov 23 '18 at 8:40











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53435757%2fd3js-v5-topojson-v3-access-to-the-objects-properties-in-the-background%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I am not sure, that this solves your problem completely, but have you tried to apply pointer-events: none CSS property to circles?






share|improve this answer
























  • Indeed, it works. Thank you again!

    – Bellice
    Nov 23 '18 at 8:40
















1














I am not sure, that this solves your problem completely, but have you tried to apply pointer-events: none CSS property to circles?






share|improve this answer
























  • Indeed, it works. Thank you again!

    – Bellice
    Nov 23 '18 at 8:40














1












1








1







I am not sure, that this solves your problem completely, but have you tried to apply pointer-events: none CSS property to circles?






share|improve this answer













I am not sure, that this solves your problem completely, but have you tried to apply pointer-events: none CSS property to circles?







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 '18 at 17:29









Yaroslav SergienkoYaroslav Sergienko

40016




40016













  • Indeed, it works. Thank you again!

    – Bellice
    Nov 23 '18 at 8:40



















  • Indeed, it works. Thank you again!

    – Bellice
    Nov 23 '18 at 8:40

















Indeed, it works. Thank you again!

– Bellice
Nov 23 '18 at 8:40





Indeed, it works. Thank you again!

– Bellice
Nov 23 '18 at 8:40


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53435757%2fd3js-v5-topojson-v3-access-to-the-objects-properties-in-the-background%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'