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

FIX and Add options to chart2music plotly integration #2

Merged
merged 21 commits into from
Jan 28, 2024

Conversation

ayjayt
Copy link
Collaborator

@ayjayt ayjayt commented Jan 26, 2024

Green!

image

Not really sure how we should proceed, if you want to keep on approving my pull requests so I can add to your pull request or if you give me permission to post to your repo here (is that possible?). It's up to you.

  • Updates w/ master.
  • Adds options to let dev control placement of closed caption div
  • Defaults from plot_config.js weren't loading during testing, so we check and reinforce at runtime. Don't love this.
  • Change default dev control placement to NOT generate a closed caption div- dev must create it.

I will post a larger comment in the pull request right now about how to move forward this.

PS. saving this link because otherwise pull requests are hard to make....

aliwelchoo:plotly.js:chart2music...geopozo:plotly.js:pikul-music-import-promise

ayjayt and others added 21 commits January 17, 2024 17:30
…ands

Add 'decimal' and 'thousands' formats for brazilian portuguese locale file
Adding a closed caption div to plotly interefered with plotly's
management of it.

We now start by default outside of the generated plotly divs.

But we add options to users can a) generate it with any id/class.

Or specify that it already exists and use an existing element by id.
Passing named empty arrays to chart2music makes it angry during
validation.
accessibility.js takes configuration variables from `plot_config.js`, modifies
them, and passes them directly to `chart2music`.

The problem is that assigning an object to a new variable doesn't copy
it, so any change to that variable also changes the original object.

Plotly uses changes (or lack thereof) in the config variables to decide if it can
shortcut certain redraw steps. It cannot if config variables change. So
if `accessibility.js` is run on every redraw, the config variables will look
different (even if they are not), and plotly will always take the long
way around during its rerendering.

That being said, this solution here may need more thought. Questions
like: when _should_ chart2music ask plotly to do a full redraw? Should
it ever? Would it do that by changing a config it has access to? Will it
ever change plotly config variables frequently.
I can't think of instance where

1) the caption div wouldn't be specified by the user
2) would maybe do some really fancy interaction w/ the graph
3) be completely invisible because its meant to be read outloud anyway

Either way, the generation strategy needs work.

* Tests now create their closed caption div
@ayjayt ayjayt changed the title Add options to chart2music plotly integration FIX and Add options to chart2music plotly integration Jan 26, 2024
@aliwelchoo
Copy link
Owner

I can give you access here, will do that!

@aliwelchoo aliwelchoo merged commit 80b4cf3 into aliwelchoo:chart2music Jan 28, 2024
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

Successfully merging this pull request may close these issues.

4 participants