Commit Graph

157 Commits

Author SHA1 Message Date
Jukka Kurkela
7ccf9e2d4d Add grace option for linear scale (#8581)
* Add `grace` option for linear scale

* cc
2021-03-06 17:18:49 -05:00
Jukka Kurkela
e3cdd7323a Move niceNum to helpers.math, cleanup IE fallbacks (#8570) 2021-03-05 08:10:24 -05:00
Jukka Kurkela
78d3d30d56 Add _allKeys descriptor for Object.keys behavior (#8553) 2021-03-01 16:44:14 -05:00
Jukka Kurkela
ae95a8221d Fix function support on _fallback (#8545) 2021-03-01 12:19:55 -05:00
Jukka Kurkela
86b1892810 Resolve to false only when _fallback is used (#8542)
* Resolve to false only when _fallback is used
* Typo
* 2nd part
2021-02-28 17:32:56 -05:00
Jukka Kurkela
53ea370f5c Clean up easing functions (#8518)
* Clean up easing functions
* Remove leftover comment
2021-02-24 18:43:37 -05:00
Jukka Kurkela
b06cd36697 Rename cutoutPercentage to cutout + chores (#8514) 2021-02-24 16:58:01 -05:00
Jukka Kurkela
ee74dd646a Add resizeDelay option (#8509)
* Add resizeDelay option
* Extract helper
2021-02-23 18:40:57 -05:00
Jukka Kurkela
639c34f89e Fix set/delete oprations on Proxies (#8506) 2021-02-23 19:46:31 +02:00
Jukka Kurkela
4c960fb138 Plugin options default scriptable/indexable=false (#8497)
* Plugin options default scriptable/indexable=false

* Update test

* Inherti desciptors

* Remove unreachable code

* remove unintentional change

* remove double default
2021-02-23 17:54:42 +02:00
Jukka Kurkela
65bfacd9a5 Add outerRadius option to doughnut/pie (#8487) 2021-02-21 17:30:37 -05:00
Jukka Kurkela
5d5e48d01b Isolate properties / modes from animation options (#8332)
* Isolate properties / modes from animation options
* tabs, something wrong with the linter
* Update misleading variable name
2021-02-20 09:02:22 -05:00
Jacco van den Berg
d264672381 Fix/getRelativePosition NaN value with native event (#8459)
* fix bug where onClick value returned NaN because originalEvent does not exist
* add test for this behaviour
* test to async
2021-02-19 17:57:59 -05:00
Jukka Kurkela
850e6e4588 Update resolver fallback logic (#8456) 2021-02-19 08:30:39 +02:00
Jukka Kurkela
5411be10a0 Add support for common object methods to Proxies (#8452) 2021-02-18 10:04:46 -05:00
Jukka Kurkela
9fb87a4fc2 Round canvas size to 0.1px resolution (#8437)
* Round canvas size to 0.1px resolution
* Types + docs
* typofix
2021-02-16 08:30:40 -05:00
Jukka Kurkela
616a877772 perf: resolveObjectKey (#8434)
* perf: resolveObjectKey
* Fix tests
* prevent string construction
2021-02-15 16:15:58 -05:00
Jukka Kurkela
cfd9c98575 Option resolution with proxies (#8374)
* Option resolution with proxies

* Remove plugin fallback to root options/defaults

* Update core plugins, reduntant font fallbacks

* Add some notes
2021-02-15 14:42:32 -05:00
Jukka Kurkela
ddfbcf777a Update eslint-config-chartjs to v0.3.0 (#8406) 2021-02-10 08:21:39 -05:00
Marcel Samyn
ff19ea4be7 fix canvas clearRect size calculation (#8328)
Co-authored-by: Marcel Samyn <marcel.samyn@lab900.com>
2021-01-18 08:59:13 -05:00
LeeLenaleee
32b3242585 Fix reading wrong property from font object for font string (#8315) 2021-01-16 21:13:13 +02:00
Jukka Kurkela
ea34e8b814 Disable Path2D caching when chart is animated (#8319)
* Disable Path2D caching when chart is animated
* Add note to performance docs
2021-01-16 14:06:27 -05:00
Jukka Kurkela
2e43f787de Fix small bugs when animations are disabled (#8253)
* Fix small bugs when animations are disabled
* Update test
2020-12-30 08:31:30 -05:00
Jukka Kurkela
e530a4d1a0 Line: Use Path2D as cache (#8239)
* Line: Use Path2D as cache
* Add comment, move to helpers, first and last point
2020-12-28 09:53:30 -05:00
Jukka Kurkela
66c92548e8 Rename helpers.clear to helpers.clearCanvas (#8238)
* Change parameters of helpers.clear

* Update test
2020-12-28 10:21:46 +02:00
Evert Timberg
78e78256a5 Cache the lineheight regex (#8240) 2020-12-28 10:19:16 +02: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
Jukka Kurkela
e1a3303c67 Legend plugin cleanup (#8109)
* Legend plugin cleanup

* cc1

* cc2

* cc3

* start/stop
2020-12-14 15:35:04 +02: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
fa997f06e2 Do not use offsetX/Y in shadow DOM (#8082)
Do not use offsetX/Y in shadow DOM
2020-11-20 15:59:48 -05: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
1b6226342a Refactor/cleanup range option handling (#8057) 2020-11-16 20:19:59 +02:00
Jukka Kurkela
183637b87f Add tests and clean up resolveObjectKey helper (#8028)
* Add tests and clean up resolveObjectKey helper

* Change the optimized path to comply with thests
2020-11-10 17:34:31 +02:00
Dan Manastireanu
495c35950c Add borderRadius to bar charts. Closes #7701 (#7951)
* Add helper to parse border radius options
* feat: Implement borderRadius for bar charts
* chore: add demo of bar charts with border radius
* chore: document bar borderRadius
* chore: update typescript with bar borderRadius property
* fix horizontal borders test failing due to antialiasing
* chore: Add border-radius visual test
2020-10-26 10:05:24 -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
Evert Timberg
ac68593873 Block incorrect keys in merge code to prevent prototype pollution (#7919)
* Port fix from v2

* Port test

* Test both merge and mergeIf
2020-10-18 21:16:20 +03: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
Jukka Kurkela
b6c22d269a Remove circular dependencies from helpers (#7898) 2020-10-16 07:53:13 -04:00
Mike Carter
0d95c7974c Fix typo in const name (#7872) 2020-10-11 11:34:52 -04:00
Jukka Kurkela
06b5325778 Add maxWidth/maxHeight options for legend (#7852) 2020-10-06 07:41:16 -04:00
Jukka Kurkela
1a9b452cda Limit pixel values further to 16bit integer range (#7848) 2020-10-05 08:37:12 -04:00
Samuel Gratzl
391e4b6f2e flat helpers (#7806)
* generate a flat helpers package
* move helpers built files to dist
* upgrade docs for flat helpers
2020-09-28 09:11:55 -04:00
Jukka Kurkela
10f393a58d Fix: maximum size and mouse position with styling (#7816)
Fix: maximum size and mouse position with styling
2020-09-26 13:18:35 -04:00
Jukka Kurkela
17e27e16cc Limit pixel values to 32bit integer range (#7800) 2020-09-15 15:33:59 -04:00
Jukka Kurkela
2c5db2c350 Fix some CC issues (#7796)
* Fix some CC issues
* Merge _lookup, _lookupByKey, _rlookupByKey
* Remove TODO from types
* Merge TRBL logics
* Merge getMaximumWidth and getMaximumHeight
2020-09-14 14:40:19 -04:00
Jukka Kurkela
2f888172d4 Cache event offset coordinates (#7795) 2020-09-14 11:37:29 -04:00
Jukka Kurkela
1cc8d50bc9 Fix: relative position in FF (#7792)
* Fix: relative position in FF
* Add tests
2020-09-13 17:20:14 -04:00
Jukka Kurkela
baa4429ad1 Use offsetX/Y or layerX/Y for events when available (#7732)
* Use offsetX/offsetY for events when available
* Fall to layerX/layerY for FF compatibility
2020-08-25 08:04:06 -04:00
Jukka Kurkela
d561486b4e Revert "Preserve object prototypes when cloning (#7381)" (#7727)
This reverts commit 51be344717.
2020-08-24 08:15:56 -04:00