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

Make all options scriptable #8008

Closed
wants to merge 7 commits into from
Closed

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented Nov 4, 2020

This one needs some refactoring/cleanup still, but I wanted to put it up here to see the size impact.

The main idea is to resolve from top to bottom, using known paths depending on the context we are resolving.
For dataset, there are 3 contexts, data element options, dataset options and controller options.

  • options are not merged with element defaults, because we need to know if user passed some element options and consider those at higher priority than defaults
  • options are flattened to dataset level (merged from top to bottom to first !== undefined value)
  • that flattened object is used to resolve against
  • option names need to be defined in defaults to be resolvable

Closes: #7408

TODO:

  • Tests
  • Animation resolution
  • Documentation

@kurkle
Copy link
Member Author

kurkle commented Nov 4, 2020

Filename Size Change
dist/chart.esm.js 62.4 kB -153 B (0%)
dist/chart.js 89.7 kB +632 B (0%)
dist/chart.min.js 61.3 kB +189 B (0%)
dist/chunks/helpers.segment.js 16.5 kB +811 B (4%)
dist/helpers.esm.js 987 B -2 B (0%)

@kurkle kurkle force-pushed the options-upside-down branch 2 times, most recently from a886302 to 63fbb0b Compare November 9, 2020 07:49
@kurkle kurkle force-pushed the options-upside-down branch 3 times, most recently from 0845eb5 to 5fb2971 Compare November 10, 2020 20:20
@kurkle kurkle force-pushed the options-upside-down branch from 88652dd to 2eedf6f Compare November 10, 2020 20:47
@kurkle
Copy link
Member Author

kurkle commented Feb 5, 2021

closing in favor of #8374

@kurkle kurkle closed this Feb 5, 2021
@kurkle kurkle deleted the options-upside-down branch March 10, 2021 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v3: (partially) derive dataElementOptions from element default options
2 participants