Code Monkey home page Code Monkey logo

Comments (5)

btbonval avatar btbonval commented on July 24, 2024

moving from visibility: hidden/visible to display: none/block helped at the outer zoom levels, but not so much at the inner zoom levels.

Perhaps a radius about the graphic's center could be used to cull outlying text ouside the focus. This would have to be a function of scale.

from books-library-stack.

btbonval avatar btbonval commented on July 24, 2024

Instead of a radius, it would be helpful to cull all text that is not displayed (outside the viewport).

This is surprisingly difficult to implement, since the only information given is the total viewport size (which appears to be absolute, irrespective of scale), the scale, and the translate (position which is relative to scale). Finding the bounding box which is displayed seems super hard. It seems like the translate marks one of the corners (upper left?), but scaling the window size into the SVG coordinate system so that it is relative to the position is not panning out.

from books-library-stack.

btbonval avatar btbonval commented on July 24, 2024

This might be best done with a D3 join:
http://bost.ocks.org/mike/join/

Perform a selectAll() on all the text in the SVG. Run a filter on the data that takes into account depth and location and returns only those elements.

enter() then corresponds to new text elements that should be added and exit() corresponds to those text elements that are no longer in the frame of reference and can be deleted.

Now instead of hiding and unhiding, we're actually culling objects from the SVG, which should improve rendering.

Caveat is still on figuring out how to determine the visible region vs the regions outside the SVG's visible canvas.

from books-library-stack.

sethwoodworth avatar sethwoodworth commented on July 24, 2024

Well what if we don't do the display:none, but only append text to circles
when we have zoomed in on it.

Zoom to a Unit, it adds the Unit name to the circle
Hover over a person, it adds the person name to the circle

On Mon, Nov 4, 2013 at 1:27 AM, Bryan Bonvallet [email protected]:

This might be best done with a D3 join:
http://bost.ocks.org/mike/join/

Perform a selectAll() on all the text in the SVG. Run a filter on the
data that takes into account depth and location and returns only those
elements.

enter() then corresponds to new text elements that should be added and
exit() corresponds to those text elements that are no longer in the frame
of reference and can be deleted.

Now instead of hiding and unhiding, we're actually culling objects from
the SVG, which should improve rendering.

Caveat is still on figuring out how to determine the visible region vs the
regions outside the SVG's visible canvas.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-27666236
.

from books-library-stack.

btbonval avatar btbonval commented on July 24, 2024

That is exactly what I was saying. ;)

"Now instead of hiding and unhiding, we're actually culling objects" ... "
and "exit() corresponds to those text elements that are no longer in the
frame of reference and can be deleted." Deleted as in remove() as in not
part of the DOM anymore.

We're on the same page. D3's data-join thing was super weird, but now that
I finally understand it, I understand how to add/update/remove DOM objects
based on dynamic criteria.

On Mon, Nov 4, 2013 at 6:04 AM, Seth Woodworth [email protected]:

Well what if we don't do the display:none, but only append text to circles
when we have zoomed in on it.

Zoom to a Unit, it adds the Unit name to the circle
Hover over a person, it adds the person name to the circle

On Mon, Nov 4, 2013 at 1:27 AM, Bryan Bonvallet [email protected]:

This might be best done with a D3 join:
http://bost.ocks.org/mike/join/

Perform a selectAll() on all the text in the SVG. Run a filter on the
data that takes into account depth and location and returns only those
elements.

enter() then corresponds to new text elements that should be added and
exit() corresponds to those text elements that are no longer in the
frame
of reference and can be deleted.

Now instead of hiding and unhiding, we're actually culling objects from
the SVG, which should improve rendering.

Caveat is still on figuring out how to determine the visible region vs
the
regions outside the SVG's visible canvas.


Reply to this email directly or view it on GitHub<
https://github.com/sethwoodworth/books-library-stack/issues/7#issuecomment-27666236>

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-27686541
.

from books-library-stack.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.