Commit Graph

1059 Commits

Author SHA1 Message Date
Ben McCann
e6dfc47927 Update spelling of cancellable (#8236) 2020-12-28 10:20:55 +02:00
Evert Timberg
7415517c83 Cache data limits to ensure they are only computed once per update (#8234)
* Cache data limits to ensure they are only computed once per updaet
* Replace `invalidateCaches` on scales with `beforeLayout`
2020-12-26 14:37:23 -05:00
Evert Timberg
988b3c5d2b Create standardized text render method (#8227)
* Create standardized text render method
* Document renderText options and enable configurable decoration width
* Add tests for font rendering
* Split color definition to it's own file
* renderText supports setting styles
* Mock context needs to track textBaseline
* renderText can set textAlign and textBaseline
* renderText does not mutate the context + translate/rotate
* Explicitly set the text decoration style
* Move useStroke logic into renderText
* Cartesian scale: Update computeLabelItems to avoid duplicate allocations
2020-12-26 11:23:02 -05:00
Evert Timberg
3ffcd93d10 Enable changing the chart type (#8226) 2020-12-23 13:38:51 -05:00
Evert Timberg
1b0ed0c8c5 Scriptable tick colours (#8222) 2020-12-22 12:11:00 -05:00
Evert Timberg
da0535e1ff Horizontal axis with center position should display labels (#8221)
* Horizontal axes with center positions should have labels
* Linting
* Test updates
* Increase the tolerance for one test
2020-12-22 11:33:53 -05:00
Evert Timberg
55a26e69ba Add options to configure tick styling independent of grid lines (#8215)
* Enable axis tick styling independent of grid lines
* Change tickMarkLength to tickLength for consistency with new options
* Add new scale options to TS definitions
2020-12-22 11:27:57 -05:00
Jukka Kurkela
7a2acebc28 Layout: enforce box limits, reject <0 chartArea (#8193)
* Skip chartArea boxes when chartArea <= 0
* Legend: limit to maxWidth/maxHeight
* Layout: enforce box limits, reject <0 chartArea
* Update legend fixtures
2020-12-18 12:56:04 -05:00
Jukka Kurkela
b2d5a5fa97 Update defaults and types for tick stroke (#8195) 2020-12-18 12:36:18 -05:00
Jukka Kurkela
b10d994017 Hover: only update styles of changed elements (#8185) 2020-12-17 15:18:02 -05:00
Jukka Kurkela
b55b361f97 Reject pending promises when animation is updated (#8184)
* Reject pending promises when animation is updated
* Add tests
2020-12-17 15:16:55 -05:00
LeeLenaleee
f191f2f5f9 Remove dataset while hovered (#8181) 2020-12-16 16:40:10 -05:00
Josh Kelley
5ed422a93a Update docs for .resize() method (#8151)
See #7678 and #8149.  (The `silent` parameter mentioned in the original 7678 no longer exists.)

Add JSDoc.

Fix some minor issues with grammar and coding style consistency.
2020-12-14 12:30:20 +02:00
Evert Timberg
93c3467182 Prevent double plugin registers from losing the list of plugins (#8162)
When `Chart.register()` was called twice in a row, the list of
plugin descriptors on the chart instance would be cleared. The
next chart update would then restart all of the plugins, not
knowing that they were already started. In the case of the Legend
and Title, this causes two boxes to appear in the layout system
thus drawing twice.
2020-12-14 12:03:08 +02:00
Jukka Kurkela
c1aeba1e67 Add new scale hooks for plugins (#8112)
* Add new scale hooks for plugins

* Add notes

* cc

* cancelability
2020-12-02 06:51:47 +02:00
Jukka Kurkela
78dbeea1f0 Add new hooks for plugins (#8103)
* Notify beforeUpdate on disabled plugins

cc?

cc2

cc3

typo

* init, unInit, enabled, disabled

self review :)

update the new hook signatures to unified

merge error

* Review update

* start/stop, cc

* types, jsdoc

* stop between destroy and uninstall
2020-11-28 22:57:45 +02:00
Jukka Kurkela
61aea761f4 Unify signature of plugin hooks (#8102) 2020-11-28 09:45:43 +02:00
Jukka Kurkela
913a01a3a6 Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins

* Update tooltip.md

* Update legend.md and title.md

* Add migration notes

* typo

* Types

* Restore plurals

* One more s, restore tabs

* All plugins disabled

* lint

* cc
2020-11-25 08:50:12 +02:00
Jukka Kurkela
e3ad31893d Restore datasets namespace (revert 6955) (#8090) 2020-11-24 22:27:51 +02:00
Jukka Kurkela
021561072b Disable all plugins when options.plugins = false (#8098)
Disabling all plugins when options.plugins = false
2020-11-23 17:58:03 -05:00
Jukka Kurkela
a29af5c62c Fix disabling hover (#8097) 2020-11-23 16:13:45 -05:00
Jukka Kurkela
2efffb8ae4 Improve test coverage (#8087)
* Remove usage of currentStyle (IE only)

* Nothing is registered in root scope anymore

* Add some more tests for animations

* Add some more tests to defaults
2020-11-23 21:06:16 +02:00
Jukka Kurkela
99aa1a4215 Switch to eslint-plugin-es (#8075)
* Switch to eslint-plugin-es

* Restore eslint-config-chartjs

* Sort
2020-11-19 21:23:24 +02:00
Jukka Kurkela
ddc72fcfbb Align font options with CSS (#8066)
* Align font options with CSS

* Review comments
2020-11-19 20:59:24 +02:00
Jukka Kurkela
f96fa2b96d Allow single parameter to Defaults.set (#8050)
* Allow single parameter to Defaults.set

* Review update

* Record
2020-11-19 20:58:24 +02:00
Jukka Kurkela
a35dade663 Enable bounds option to all cartesian axes (#8060) 2020-11-16 15:01:47 -05:00
Jukka Kurkela
1b6226342a Refactor/cleanup range option handling (#8057) 2020-11-16 20:19:59 +02:00
Jukka Kurkela
fde84f272a Chart.register: preserve existing defaults (#8052) 2020-11-14 14:38:38 -05:00
Jukka Kurkela
c2dd264fe8 Events: Only render when needed (#8049) 2020-11-13 17:35:40 -05:00
emmcbd
7ad91817e7 Improved types for defaults (#8025) 2020-11-08 09:52:41 -05:00
Jukka Kurkela
d74a5d7552 Add type to context objects (#8007) 2020-11-08 08:43:55 -05:00
Evert Timberg
17f6edb650 Remove I prefix from TS types (#8017)
* Remove I prefix from TS types
* Update missing `ILayoutItem` typedefs
* IEvent should become ChartEvent
* Prevent FillTarget collision
* Import FontSpec instead of IFontSpec
* Prevent recursive DateAdapter problem
2020-11-07 08:35:19 -05:00
Jukka Kurkela
10ffe753d9 When data is removed, remove from stacks too (#8013)
* When data is removed, remove from stacks too
* Remove unreferenced metasets
2020-11-06 08:05:56 -05:00
Jukka Kurkela
aae53c835e Use same merging logic for init and update (#8006)
* Use same merging logic for init and update
* Add test
2020-11-04 15:52:20 -05:00
Evert Timberg
0476243539 Remove draft features (#7996) 2020-11-03 08:15:56 -05:00
Jukka Kurkela
4daf37e864 Delay resize to just before draw when animating (#7989)
* Remove unused properties
* Delay resize to just before draw when animating
* Remove silent resize, update migration guide
* Fix typo in migrations doc

Co-authored-by: Evert Timberg <evert.timberg+github@gmail.com>
2020-11-01 08:15:43 -05:00
Jukka Kurkela
23bf7c0c89 Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context
2020-11-01 07:39:08 -05:00
Takuya Uehara
7b6737a209 Check index bounds of datasets for isDatasetVisible (#7986)
* Check index bounds of datasets
* Add test for isDatasetVisible
2020-10-31 08:10:17 -04:00
Jukka Kurkela
4f2511aff3 Relocate dataset defaults to defaults.controllers (#7979) 2020-10-30 18:34:32 -04:00
Dan Manastireanu
aad748dc5a feat: Make options.layout.padding scriptable. Closes #7873 (#7968) 2020-10-28 11:28:17 -04:00
Jukka Kurkela
6dbb7e7446 Move config handling to a dedicated script (#7939)
* Split core.config.js out of core.controller.js

* Remove side effects from config.js

* Turn config into a class

* Refactor config merging as includeDefaults
2020-10-24 18:37:37 +03:00
Jukka Kurkela
58d1911d05 Add args.mode to before/after update plugin hooks (#7949) 2020-10-24 18:36:31 +03:00
Jukka Kurkela
6a72bcbeca Rename showLines to showLine (#7936) 2020-10-21 08:13:27 -04:00
Evert Timberg
bc11f10216 Rename elements to mark as elements, i.e. Arc -> ArcElement (#7924)
* Rename elements to mark as elements, i.e. Arc -> ArcElement
* Rename RectangleElement to BarElement
* Also updates options.elements.rectangle to options.elements.bar
2020-10-20 08:18:56 -04:00
Jukka Kurkela
f5c4f97504 Add interaction options (#7922)
* Add interaction options
* Add migration note
2020-10-19 07:24:06 -04:00
Jukka Kurkela
73b4e82fd5 Use Object.create(null) as merge target, to prevent prototype pollution (#7917)
Use Object.create(null) as merge target to prevent polluting `Object.prototype`
2020-10-18 13:31:01 -04:00
paul cheung
7ce9710f33 fix some typos (#7914) 2020-10-18 16:52:56 +03:00
paul cheung
b31a815382 some minor typo fix (#7913) 2020-10-18 09:35:21 -04:00
Matthew Crumley
7a35f3cb3e Fix Maximum call stack size exception in _computeLabelSizes (#7906)
Issue #7881
2020-10-18 06:52:56 +03:00
Evert Timberg
4a191d5af9 Document and remove APIs that can be replaced by it (#7900) 2020-10-17 15:12:34 -04:00