Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoom and fill into center instead of left aligned #1

Open
btbonval opened this issue Oct 24, 2013 · 10 comments
Open

zoom and fill into center instead of left aligned #1

btbonval opened this issue Oct 24, 2013 · 10 comments

Comments

@btbonval
Copy link
Collaborator

When clicking on things which are zoomed, the zoom expands the window but centers the subject on the left side instead of closer to center.

zoom function is here:
https://github.com/sethwoodworth/books-library-stack/blob/master/wireframes/03/js/faculty_render.js#L112

@btbonval
Copy link
Collaborator Author

Actually, it is left aligned at all times in Firefox.

Instead of JS, this can probably be fixed via some CSS guides. The elements might be instantiated dynamically, but classes can be added dynamically as well.

@btbonval
Copy link
Collaborator Author

<section class="vis"> contains both the bubbles and the text. One goal was to have bubbles and text both be more centered, in which case the vis class is the correct thing to change. However, I think I prefer the text box being right aligned. My tiny screen does not give much room for both to be squished any further together.

@btbonval
Copy link
Collaborator Author

changing the margin or padding of the .faculty-by-unit class moves the entire drawing, so there is less total drawing, although it is more centered.

It turns out we care more about how the SVG is drawn respective to its container than the positioning of the container itself. CSS is not a good solution.

@btbonval
Copy link
Collaborator Author

It might be better to try to use D3's built in zoom/translate capabilities:
https://github.com/mbostock/d3/wiki/Zoom-Behavior#wiki-zoom

@btbonval
Copy link
Collaborator Author

SVG geometric zooming
http://bl.ocks.org/mbostock/3680999

@btbonval
Copy link
Collaborator Author

The above works for moving and zooming around the bubble map as a user. It doesn't respect zoom level in any obvious way, although there would be three zoom levels of interest if that could somehow be captured.

There should be a way to capture the zoom object in order to translate/zoom it when items in the right text box are clicked, but it doesn't seem super easy at first glance.

@btbonval
Copy link
Collaborator Author

New branch feature_d3_zoom was created for this feature.

All text is now shown, for #3. Need to determine zoom level to show/hide text based on node depth, because it is unreadable right now.

One can zoom and translate about the map easily with double click, touch, and mouse wheel.

The connection between text box and circles has been lost, related to #6. This will need to be regained. The text box, when something is clicked within it, should able able to use zoom.center() to focus on the

@btbonval
Copy link
Collaborator Author

click to zoom, much like the function in main, but zooms out when the thing zoomed into is clicked on:
http://bl.ocks.org/mbostock/2206590

zoom slider, which should help capture the discrete zoom levels and make it clear where to zoom out:
http://thisismattmiller.com/blog/add-zoom-slider-to-d3-js/

@btbonval
Copy link
Collaborator Author

This text is too long to be readable without word wrap. SVG does not do word wrap as such, but peeps be fixin probs:
http://svgjs.com/textflow/

@btbonval
Copy link
Collaborator Author

textflow didn't work with the d3 stuff.

manually adjust the text? some wordwrap code:
http://james.padolsey.com/javascript/wordwrap-for-javascript/
unlicensed:
http://james.padolsey.com/terms-conditions/

btbonval added a commit that referenced this issue Oct 30, 2013
…justed the word wrap limit based on one or two ugly cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant