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 line properties scriptable #6128

Merged

Conversation

janelledement
Copy link
Contributor

Background:

This PR introduces scriptable capability to these line options:

  • backgroundColor
  • borderColor
  • borderWidth
  • borderCapStyle
  • borderJoinStyle
  • borderDash
  • borderDashOffset
  • fill
  • cubicInterpolationMode

Testing:

Wrote fixture tests for all the line options listed above.

Updated a test in plugin.filler.tests.js: 'should ignore invalid values'. (This test formerly listed functions as an ignored value for 'fill').

Documentation:

Updated the line chart documentation to acknowledge that these line options are also scriptable.

Updated the line sample to demonstrate scriptable background color.

etimberg
etimberg previously approved these changes Mar 14, 2019
Copy link
Member

@etimberg etimberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have one minor comment. looks good!

kurkle
kurkle previously approved these changes Mar 14, 2019
etimberg
etimberg previously approved these changes Mar 14, 2019
benmccann
benmccann previously approved these changes Mar 15, 2019
Copy link
Member

@simonbrunel simonbrunel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @janelledement!

I know it's a lot of work but I would change a few things in the unit tests. I would first make sure no element (line/point) are cut by setting layout padding. Else, some tests are useless (e.g. border cap). And I would make the scriptables simpler (no reduce()), easier to read and maintain.

samples/scriptable/line.html Outdated Show resolved Hide resolved
samples/scriptable/line.html Outdated Show resolved Hide resolved
src/controllers/controller.line.js Outdated Show resolved Hide resolved
src/controllers/controller.line.js Outdated Show resolved Hide resolved
test/fixtures/controller.line/borderCapStyle/scriptable.js Outdated Show resolved Hide resolved
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
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.

None yet

7 participants