markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

Update the Documentation and Examples with Note on position:relative #119

Closed clintonb closed 10 years ago

clintonb commented 10 years ago

My team just spent a few hours trying to figure out why tooltips for a map at the bottom of the page were displaying at the top of the page. It turns out the element containing the map/tooltip needs to have position: relative set. Please update the documentation to reflect this requirement.

<!-- Wrong -->
<div>
  <svg>Map goes here</svg>
  <div class="hover-info" style="position:absolute"> Datamaps sets position on this element.</div>
</div>
<!-- Correct -->
<div style="position: relative">
  Developer must set position: relative above.

  <svg>Map goes here</svg>
  <div class="hover-info" style="position:absolute"> Datamaps sets position on this element.</div>
</div>
markmarkoh commented 10 years ago

hey @clintonb, is there anywhere specific I need to update the docs? In the README.md file it has the positions:relative part, but I could be missing it elsewhere.

clintonb commented 10 years ago

@markmarkoh Admittedly, after downloading the package I didn't read the README. I just jumped straight to adapting an example for my purposes. In hindsight, had I read the README, I probably would have resolved the issue within a few minutes. It may help to be more explicit and update step 3 to read Add a container, set the height and width, set position to relative.

markmarkoh commented 10 years ago

That's perfect, I'll update that part. ( I can't/don't expect people to go through the README )

clintonb commented 10 years ago

Thanks!