Closed mmontesanonyc closed 1 month ago
Potential implementation:
vegaEmbed(...)
in any of the chart view functions, make that spec the value of printSpec@cgettings - branched off of hotfix-DE-pallette
to work on a chart printer, on feature-chart-printer
. Overall this works by having a printSpec
variable, and on any given vegaEmbed(...)
call, map.js
or comparisons.js
defines printSpec with the contents of the spec it's drawing (I threw var printSpec
at the top of data.js but there may be a better place for it.), so we can pass it in to another vegaEmbed call later.
Also,
print.js
file to keep things separate, since this will include some additional logic to modify the specs for printingsetTimeout
, that code draws the chart in the modal. Trying to do this at the same time caused some bugs and failures - seems that the modal needs to be fully rendered before we can draw a chart in there reliably.No rush on this but I'd love your thoughts on this approach.
Stil to come is adding some logic to print.js
that modifies the spec - adding year and neighborhood to the map, adding the legend to the trend chart... This stuff actually may have to happen with renderMap
and renderComparisons
in order to use the indicator metadata, so I might wind up writing alt-specs in those functions.
hey @etorem when you have a moment can you serve up this branch and take a look at a DE map or trend chart, and let me know what you think about the "print" option? curious for your take on the ux.
I think this looks nice!
Rolling up work in #1127 which itself rolled up work in #1080 and developing a fairly significant release branch, this includes:
renderAboutSources
to see if sources
is an array full of identical things, and only taking one if that's the caseinteractive: false
to several layers
Changes in #1127, especially removing the legend given better hover interaction, make me think about the use case of screenshotting/saving/printing visualizations, and how this conflicts with organizing information optimized for interaction.
I wonder if it would be good to have a "print visualization" button that activates a few other options, like:
Upon print button click, we could even open a modal with a bit of information on how to click the actions menu and save as PNG or SVG, with the visualization rendered in the modal.