Commit Graph

11 Commits

Author SHA1 Message Date
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
55dd7ded0e
Remove duplicate Scriptable definitions (#8223) 2020-12-22 13:10:25 -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
Evert Timberg
ec7b381345
Split animation definitions (#8208) 2020-12-20 13:26:09 -05:00
Evert Timberg
388918924f
Split Element type to it's own definition file (#8206) 2020-12-19 21:56:11 +02:00
Jukka Kurkela
dd382bc806
Split adapter types to their own definition file (#8205)
* Split adapter types to their own definition file
* Sort & separate
2020-12-19 14:03:26 -05:00
Evert Timberg
75fcd4fffa
Split geometric types to their own definition file (#8202)
* Split geometric types to their own definition file
* Re-export types
2020-12-19 13:39:35 -05:00
Evert Timberg
a182cbed7b
Merge TS files into a single file to prevent circular loops (#8198) 2020-12-19 10:37:33 -05:00
Josh Kelley
efbaf2c082
TypeScript updates (#8190)
* Update type definitions and docs for legends

* Fix types for onHover and onClick callbacks

core.controller.js's implementation also passes the Chart instance as `this`. However, that isn't documented, and it's my impression that Chart.js is moving away from passing items as `this`, so I didn't declare it in the type definitions.

* Allow multi-line ticks

* Stricter DeepPartial definition

The previous definition resolved to `{}` (which can allow primitives) if it was given a function, so it was far too broad for any `Scriptable<>` properties.

* Grammar and writing style

* Updates to animation docs

Document the `fn` option, since it's in the type definitions.

Fix callback usage to match example code.

* Fix AnimationEvent parameter

The onProgress and onComplete events were mistakenly declared as taking the standard DOM AnimationEvent.  (Should Chart.js's AnimationEvent be renamed to ChartAnimationEvent to avoid any possible ambiguity?)

* Allow false for disabling animations

* Add comments explaining the layout and usage of Rollup
2020-12-18 12:46:54 -05:00
Samuel Gratzl
4eeed6e876
WIP: TypeScript types (#7668)
First version of types
2020-08-04 16:52:57 -04:00