Commit Graph

371 Commits

Author SHA1 Message Date
Jukka Kurkela
22e367c445
Make indexable options looping (#7442)
* Make indexable options looping
* Migration note
2020-05-29 16:27:10 -04:00
Jukka Kurkela
f472a3f9a7
Remove proposal and obsolete features (#7425) 2020-05-26 19:16:23 -04:00
Jukka Kurkela
ebccf225b9
Alter test to require fever iterations (#7426) 2020-05-26 18:10:28 -04:00
Yiwen Wang
94763bff35
Fix chart resizing issue (#7297) (#7298)
Fix chart resizing issue
2020-05-25 16:54:55 -04:00
Evert Timberg
13b8924ac3
Legend onClick callback supports arrow functions (#7410)
#7409 Legend callbacks support arrow functions
The `Legend` is no longer implicitly found through `this` and instead
passed as an explicit argument to the callback functions.
2020-05-24 10:28:41 -04:00
Jukka Kurkela
5a83a80811
Move font* to font.* (#7383) 2020-05-21 17:07:06 -04:00
Jukka Kurkela
39eb39008d
Rename platform/platform to index removing default (#7391)
Rename platform/platform to index removing default
2020-05-21 16:36:06 -04:00
Jukka Kurkela
cfb5fba527
Delay animations until attached (#7370)
* Delay animations until attached
* Detect container detachment
2020-05-20 17:45:44 -04:00
Jukka Kurkela
51be344717
Preserve object prototypes when cloning (#7381) 2020-05-20 17:40:42 -04:00
Jukka Kurkela
50f2a1097a
Detect data modifications with equal values (#7350)
Fix data shift-push with identical values
2020-05-19 17:58:53 -04:00
Ben McCann
a301ca148c
Add a scale.init method (#7346) 2020-05-12 16:44:40 -04:00
Jukka Kurkela
32de1b6ebf
Support isoWeekday when rounding (#7269) 2020-04-13 19:34:18 -04:00
Ben McCann
14021d369a
Remove unused layouts.defaults (#7264)
* Remove unused layouts.defaults
* Add to migration guide
2020-04-11 08:46:33 -04:00
Ben McCann
d560f9dbad
Fix overlapping ticks on log scale (#7242) 2020-04-03 18:12:34 -04:00
Ben McCann
ee0aa0c116
Fix filterBetween (#7211)
* Fix filterBetween
* Update with review suggestions
2020-03-24 12:49:48 -04:00
Ben McCann
53205457dc
Add tests for rendering to offscreen canvas (#7175)
Add tests for using an offscreen canvas for Chart.js. These tests are
almost identical to existing tests, but with offscreen canvas enabled.

Co-authored-by: David Winegar <david.winegar@getcruise.com>
2020-03-06 12:17:12 -05:00
Jukka Kurkela
a3dddb45d9
Use global element hidden status for Pie charts (#7156)
Use global element hidden status for Pie / polarArea charts
2020-03-01 09:07:39 -05:00
Jukka Kurkela
3b915cbdd3
Convert some of the time scale tests to fixtures (#7154)
* Convert some of time scale tick tests to fixtures
* A little more threshold
2020-02-28 18:56:22 -05:00
Ben McCann
3c1e04f928
Allow registering scale with single parameter (#7157)
Allow registering scale with single parameter
2020-02-27 19:38:10 -05:00
Jukka Kurkela
774493e23d
Add some tests to improve coverage (#7164) 2020-02-27 19:37:11 -05:00
Jukka Kurkela
ac69e81b04
Turn elements/index into an index (#7135) 2020-02-26 18:08:29 -05:00
Jukka Kurkela
5e489f16f6
Issue 4991 (#7084)
* Fix remaining handleEvent issues

* Reduce lines

* Update tooltip always on replay

* Address issues

* Fix test

* More tooltip fixing

* Extend comment
2020-02-25 14:35:32 -05:00
Jukka Kurkela
a9ae64f1e2
Stop leaking fonts (and fillStyle) to ctx (#7150) 2020-02-23 13:08:01 -05:00
Jukka Kurkela
d801e56106
Update dependencies and alter privacy of functions (#7138)
* Update dependencies

* Fix privacy problems

* color lib & consistency

* Review update

* getLabelCapacity

* Review update
2020-02-22 08:35:16 -05:00
Jukka Kurkela
7b029aa780
Doughnut / PolarArea cleanup (#7113)
Doughnut / PolarArea cleanup
2020-02-17 18:45:30 -05:00
Jukka Kurkela
bfe34214ac
Use ResizeObserver and MutationObserver to detect detach/attach/resize (#7104)
* Use Resize/MutationObserver to detect detach/attach/resize
* Cleanup
* Review update
* Restore infinite resize detection (#6011)
2020-02-17 11:00:03 -05:00
Jukka Kurkela
f0fd28af66
Allow "spriting" text in fixtures (#7073)
Allow "blit" text drawing in fixtures
2020-02-14 12:33:08 -05:00
Jukka Kurkela
7c1fb37c61
Babel @kurkle/color for IE support (#7099)
Babel @kurkle/color for IE support
2020-02-14 12:29:33 -05:00
Ben McCann
2f17dbcd70
Prefix private controller methods with underscore (#7081)
Prefix private controller methods with underscore
2020-02-10 17:57:22 -05:00
Jukka Kurkela
44a624f2d1 Fix typo and update dependencies (#7077)
* Fix typo and update dependencies
* Update `isColorInstance`
2020-02-09 20:14:38 -05:00
Ben McCann
12ea8d86ca
Fix time scale computeOffsets (#7072) 2020-02-08 18:08:42 -05:00
Jukka Kurkela
fa79eb8797
Switch from chartjs-color to @kurkle/color (#7059) 2020-02-07 19:24:29 -05:00
Ben McCann
a30f753321
Finishing removing old major/minor options (#7042)
* Finishing removing old major/minor options
* Fix samples
2020-02-05 18:20:01 -05:00
Ben McCann
f5d9892ad8
Improved formatting of numeric scale labels (#7007)
* Improved formatting of numeric scale labels

* Put locale on options

* Use scientific notation for big ticks

* Remove extra parameter
2020-02-03 07:36:30 -05:00
Ben McCann
d449bbc83a
Remove unused helpers (#7039) 2020-01-30 19:23:40 -05:00
Ben McCann
c667a9ef85
Move text helpers and reduce scope of imports (#7028) 2020-01-30 19:19:53 -05:00
Ben McCann
1ae11c4d40 Format numbers in tooltip (#7004)
* Format numbers in tooltip
* Add check for typeof number
* Implement only for linear and log scales
2020-01-27 17:58:58 -05:00
David Winegar
1ad5f369af Allow switching platforms (#6964)
Allow switching platforms

Move the Chart.platform to Chart.platform.current instead, and add
ways to see available platforms and set the current platform. This
is necessary for adding tests that use the "basic" platform.
2020-01-26 15:33:20 -05:00
Jukka Kurkela
14df2c6722 Enable imports for tests (#6997) 2020-01-21 15:44:14 -05:00
Jukka Kurkela
b05699eec5 Clean up after test (#6976)
* Clean up
* Make sure the event is inside chart are
2020-01-21 15:43:41 -05:00
Jukka Kurkela
fb19b77e4b Fix tooltip for 'dataset' mode (#6961) 2020-01-21 09:48:58 -05:00
Evert Timberg
5aaff3a1aa
Convert Tooltip to a plugin (#6990)
* Convert Tooltip to a plugin
* code review feedback
* Update docs. Convert positioners map to be on the plugin directly
2020-01-21 06:36:53 -05:00
Evert Timberg
b097fe43c9
Linear scale with min/max/stepSize set should use all 3 if the range fits (#6966)
When (max - min) / stepSize is an integer, we can do a very simple
tick generation method.
2020-01-18 08:35:30 -05:00
Jukka Kurkela
767ffc05ce Resize on zoom (#6974)
* Resize on zoom
* Add test
2020-01-17 19:07:28 -05:00
Jukka Kurkela
a1c2dd6fb6 Throttle all events (to 1 / frame each) (#6953)
* Throttle all events
* Asynchronize event tests
2020-01-14 07:34:08 -05:00
Ben McCann
9bd2af9e9b Move location of dataset options (#6955)
* Move location of dataset options
* Fix misplaced period
2020-01-13 19:39:30 -05:00
Jukka Kurkela
f1817979a0 Fix log scale calculations (#6903)
* Fix log scale calculations
* Fully remove _valueOffset
* Invalidate 0
* Review update
* Skip NaN

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
2020-01-13 19:36:50 -05:00
Jukka Kurkela
16b1fb11b4 waitForResize before resizing (#6954)
* waitForResize before resizing
* Change the failing test
* Change the other leaking test too
2020-01-13 19:35:44 -05:00
Jukka Kurkela
5e6fb37646 Detect stack change (#6947)
* Detect stack change
* Add test
2020-01-13 19:33:24 -05:00
Jose Raul Pérez
b1421c6ea1 Add stroke lines option around ticks to improve readability (#6787)
Enable stroking of text on of axis labels
2020-01-12 14:22:51 -05:00
Jukka Kurkela
f1677b6652 Limit interactions to chartArea (+/-0.5px) (#6943)
Limit interactions to chartArea (+/-0.5px)
2020-01-11 18:10:32 -05:00
Jukka Kurkela
5054ecfd7e Re-parse existing elements when data is replaced (#6925)
* Re-parse existing elements when data is replaced
* Update test
2020-01-10 18:31:17 -05:00
Ben McCann
d4109ca14e Polar area: startAngle in degrees, 0 at top. (#6936)
* Polar area: startAngle in degrees, 0 at top.
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2020-01-10 18:30:29 -05:00
Evert Timberg
d04cdfc21f
Add the ability to add a title to the legend (#6906)
* Add the ability to add a title to the legend

- Legend title can be specified
- Font & color options added
- Padding option added
- Positioning option added
- Legend title sample file added
2020-01-10 18:28:51 -05:00
Jukka Kurkela
16bb94ebc1 Bar chores (#6889)
* Limit invisible bar section size

* Improve readability

* Fix for issue 6368

* Raview update

* Review update, add test

* Typos

* Try to make sense :)
2020-01-08 17:27:17 -05:00
Ben McCann
3b55de73fa Improve calculation for number of ticks that can fit (#6927) 2020-01-07 07:26:29 -05:00
Evert Timberg
9cb65d2c97
Add API to change data visibility (#6907) 2020-01-06 17:16:00 -05:00
Evert Timberg
ac85ce41db
Handle font sizes that are set as strings (#6921) 2020-01-06 07:40:49 -05:00
Jukka Kurkela
b5d5ed987a Internal data by axis instead of scale id (#6912)
* Internal data by axis instead of scale id

* Test

* Update test

* Update docs
2020-01-06 07:22:18 -05:00
Evert Timberg
b464999851
Bar chart defaults to begin at zero (#6917)
* Bar chart defaults to begin at zero

* Add bar beginAtZero test
2020-01-05 15:50:24 -05:00
Evert Timberg
5f6c3df6dc
Title alignment options (#6908)
* Add alignment options for title plugin.

Alignment can be set to 'start', 'center'. or 'end'. A new sample has been added as well.

* Update sample file title
2020-01-05 14:59:57 -05:00
Ben McCann
ecb0784f0d Remove minSize (#6910) 2020-01-05 10:42:42 -05:00
Jukka Kurkela
f4792306e0 Remove global from defaults (#6893) 2020-01-03 14:07:38 -05:00
Evert Timberg
e96ad6f249
Remove HTML legend that is mostly unsupported. (#6887)
* Remove HTML legend that is mostly unsupported.

Resolves the discussion in #5070

* Add migration docs
2020-01-03 13:56:11 -05:00
Jukka Kurkela
03f65d4e7f Linear scale: use suggested limits as defaults (#6892)
* Linear scale: use suggested limits as defaults

* Review update
2020-01-03 09:07:33 -05:00
Ben McCann
f388ed3136 Remove outdated element tests (#6869) 2020-01-01 16:02:17 -05:00
Jukka Kurkela
102a311b44 Rewrite filler (#6795)
Filler plugin is rewritten and test coverage increased
2019-12-31 12:56:15 -05:00
Jukka Kurkela
0b68786c04 Resync metasets array when indices change. (#6864)
* Resync metasets array when indices change.
* Make sure _metasets is initialized
2019-12-28 09:49:34 -05:00
Jukka Kurkela
b83f64b16e Rewrite animation logic (#6845)
* Rewrite animation logic

* Review update 1

* Review update 2

* Review update 3

* Add 'none' to api.md
2019-12-27 17:13:24 -05:00
Ben McCann
fc7a72a8c1 Remove helpers.where and unnecessary calls to helpers.each (#6860)
* Remove unnecessary calls to helpers.each

* Remove where
2019-12-25 08:21:42 -05:00
Ben McCann
2bef1e9f23 Remove executable bit from tests (#6854) 2019-12-20 21:14:41 -05:00
Ben McCann
fc158eea89 Fix log scale autoSkip issues (#6853) 2019-12-20 21:14:21 -05:00
Jukka Kurkela
d60f634ff0 Fix automatic min value of stacked scale. (#6851) 2019-12-19 14:58:23 -05:00
Evert Timberg
c8bdca62e8
Move all helpers to src/helpers (#6841)
* Move all helpers into src/helpers

* Move curve helpers to their own file

* DOM helpers moved to their own file

* Update migration docs

* Remove migration docs on new functions
2019-12-17 08:04:40 -05:00
Evert Timberg
374b7491a3
Allow axes to be centered on the chart area (#6818)
Allow axes to be centered on the chart area or at a dynamic position based on another axis
2019-12-16 18:17:42 -05:00
Ben McCann
e25936648c Optimize tooltip event handler (#6827)
* Optimize tooltip event handler

* Address review comments

* Additional cleanup
2019-12-15 08:26:17 -05:00
Ben McCann
2be634a478 Interactions cleanup (#6825) 2019-12-14 13:09:50 -05:00
Ben McCann
3baade7862 Tests and fixes for data watching (#6831)
* Tests and fixes for data watching
* Remove call to _configure
2019-12-13 23:51:59 -05:00
Ben McCann
6f6005d7b8 Shrink _parsed to match if dataset shrinks (#6826) 2019-12-10 18:57:21 -05:00
Ben McCann
b7caa2410c Store parsed data more similarly to provided data (#6814)
* Store parsed data more similarly to provided data

* Add test
2019-12-08 08:52:11 -05:00
Evert Timberg
5a99dff5f7
Convert src/helpers to use ES6 exports (#6797)
* Canvas helpers exported
* Easing helpers use exports
* Math helper uses export
* Linting
* RTL options use export
* Allow object spread operator
* Rest of helpers use `export`
2019-12-01 13:28:34 -05:00
Jukka Kurkela
ce74eb76a1 Convert axis options from arrays to objects (#6773)
* Convert axis options from arrays to objects

* Updated all chart type defaults
* Throw errors when axis type or position are not specified
* Avoid raising unnecessary errors when merging options into the default configs

* Fix additional tests

* Ensure scale defaults are set if type is not explicitly defined

* Another step

* Include `scale` as `firstIDs.r`

* update docs

* Update for buildOrUpdateScales

* Update migration guide

* Add test back
2019-11-21 18:46:49 -05:00
L M
18e3bc0624 Allow filling above and below with different colors (#6318)
Two colors allowed : first one to fill above the target, second to fill below
Tests added
Docs edited
2019-11-21 13:48:31 -05:00
Jukka Kurkela
1a9db4783c Remove _ctx from Element (#6764)
* Remove _ctx from Element

* Sort
2019-11-19 19:01:32 -05:00
Ben McCann
edbeaac29f Remove _getPixelForOffset (#6763)
* Remove _getPixelForOffset

* Update migration guide
2019-11-19 07:09:50 -05:00
Jukka Kurkela
eb0751c6d0 Point cleanup (#6755)
* remove steppedLine from Point
* Remove tension from Point
* Migration guide, private
2019-11-17 20:28:13 -05:00
Jukka Kurkela
7f97adf5a0 Move scale defining options up from ticks (#6738)
* Move scale defining options up from `ticks`
* Include `ticks.reverse` in v3-migration
2019-11-15 12:11:13 -05:00
Ben McCann
c12ca17e38 Remove unused helpers.canvas.roundedRect (#6734) 2019-11-15 07:49:41 -05:00
Ben McCann
cb95a36b94 Fix value passed to getPixelForTick (#6724) 2019-11-14 07:15:44 -05:00
Jukka Kurkela
76a89f0922 determineDataLimits optimizations (#6695) 2019-11-12 19:24:07 -05:00
Ben McCann
cd8f3846e3 Remove helpers.previousItem/nextItem (#6727) 2019-11-12 19:18:58 -05:00
Ben McCann
09ef08acfe Remove Element _index and _datasetIndex for real this time (#6726)
* Remove Element _index and _datasetIndex for real this time

* Remove unused _datasetIndex
2019-11-12 19:18:29 -05:00
Jukka Kurkela
30cbdc6a4d Convert element.line mock tests to fixtures (#6730) 2019-11-12 13:59:29 -05:00
Jukka Kurkela
d5b6698d8c Performance improvements (#6729) 2019-11-11 18:28:17 -05:00
Ben McCann
49c4761e1b Don't make legend empty when fill is false (#6718) 2019-11-10 20:03:38 -05:00
Ben McCann
a3392e0e59 Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements.
2019-11-10 07:52:12 -05:00
Evert Timberg
94afa63450
Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality

* Remove docs

* Code review updates
2019-11-07 06:27:49 -05:00
Ben McCann
e42413f3e8 Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide
2019-11-05 18:10:44 -05:00
Ben McCann
7a2160461d Remove unused Element methods (#6694) 2019-11-05 18:09:44 -05:00
Jukka Kurkela
72df272234 Early data parsing, stacking by value and support object data (#6576)
* Early data parsing + stacking by value
* Review comments
* review comments
* Remove reduntant parsing
* Couple CC warnings
* Optimize filterBetween
* More migration info
2019-11-04 18:07:01 -05:00