Commit Graph

1925 Commits

Author SHA1 Message Date
Jukka Kurkela
ffe4ab14dc Remove options.scale, in favor of options.scales.r (#8393)
Remove options.scale, in favor of options.scales.r
2021-02-06 16:19:21 -05:00
Jukka Kurkela
505afa7f13 Fix element creation for large dataset (#8388)
* Fix element creation for large dataset
* Fix syncing
* Remove duplication
2021-02-05 17:53:05 -05:00
Ben McCann
eb7ce4e5a0 Add raw data to context and rename dataPoint to parsed (#8318)
* Make the raw data point available in scriptable context
* Rename variables
* Update samples
2021-02-05 09:13:32 -05:00
Jukka Kurkela
4491732ad5 Prevent 2nd parse call with zero count (#8379) 2021-02-04 16:59:57 -05:00
Evert Timberg
650956b2e1 Create a new hook to enable data decimation (#8255)
* Create a new hook to enable data decimation

The `beforeElementUpdate` hook can be used to decimate data. The chart
elements will not be created until after this hook has fired ensuring that
if decimation occurs, only the needed elements will be created.

* Address code review feedback

* Rename hook to beforeElementsUpdate

* Simplify parsing logic

* Add decimation plugin to the core

* Allow a dataset to specify a different data key

* Decimation plugin uses the dataKey feature

* Refactor the decimation plugin to support configurable algorithms

* Lint the plugin changes

* Tests for the dataKey feature

* Convert test files to tabs

* Standardize on tabs in ts files

* Remove the dataKey feature

* Replace dataKey usage in decimation plugin

We define a new descriptor for the `data` key allowing the
plugin to be simpler.

* Disable decimation when indexAxis is Y

* Simplify the decimation width approximation

* Resolve the indexAxis correctly in all cases

* Initial documentation

* Reverse check

* Update TS definitions for new plugin options

* Move defineProperty after bailouts

* Add destroy hook
2021-02-01 16:37:32 -05:00
Jukka Kurkela
2890b7022b Shave off some bytes (#8362) 2021-02-01 08:39:43 -05:00
LeeLenaleee
ae0c8dd457 align text inside chart for far-aligned labels passing test (#8359)
* align text inside chart for far-aligned labels

* added fix for failing test on suggestion of @kurkle

Co-authored-by: Marcel Samyn <marcel.samyn@lab900.com>
2021-01-31 15:19:40 -05:00
Jukka Kurkela
ad84d285d8 Rename LayoutItem.fullWidth to fullSize (#8358) 2021-01-31 13:44:44 -05:00
LeeLenaleee
b50fba3759 Fix/scatter tooltip mode (#8354)
* scatter tooltip should be point by default
* edited mode on better level and updated docs to be bit more clear
2021-01-30 16:22:01 -05:00
LeeLenaleee
bc312d0dbc feature: choose custom point style for bar legend display (#8341)
* add feature to choose custom point style for bar legend display
* add documentation and type
* the docs are in the right place now
2021-01-30 11:02:08 -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
Ben McCann
00dbe71dbb Revert "Update spelling of cancellable (#8236)" (#8312)
This reverts commit e6dfc47927.
2021-01-16 21:14:15 +02: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
1dc2384796 Only draw points when radius >= 0.1 (#8302) 2021-01-13 07:44:03 -05:00
LeeLenaleee
aa9a04a014 Skip delete undefined stack (#8291)
* fixes error on undefined stacks
* added test for functionality
2021-01-09 10:27:18 -05:00
Jukka Kurkela
0c48c1148a Fix resize bug of line / radar charts (#8266)
* Line: Make sure control points are re-calculated

* Radar: always set point on update
2021-01-05 07:24:12 +02:00
Jukka Kurkela
610461d714 Use provided options in tooltip plugin (#8254) 2020-12-31 08:46:23 +02:00
Jukka Kurkela
d00ffdcd76 Tooltip: Render when animations are disabled (#8252) 2020-12-30 08:33:30 -05:00
Jukka Kurkela
6ffc380c6a Line: Set points on resize (to reset Path2D cache) (#8250) 2020-12-30 08:31:44 -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
c2091fc77d Skip reset when animations are disabled (#8248)
* Skip reset when animations are disabled
* Review update
2020-12-29 10:10:32 -05:00
Jukka Kurkela
12682c619d Always freeze cached options (#8247) 2020-12-29 08:45:07 -05:00
Jukka Kurkela
dd570f676d Line: Update points directly, when possible (#8246) 2020-12-29 09:02:03 +02:00
Jukka Kurkela
59000abd1d Use cached Intl.NumberFormat everywhere (#8244) 2020-12-28 12:31:19 -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
Ben McCann
e6dfc47927 Update spelling of cancellable (#8236) 2020-12-28 10:20:55 +02:00
Evert Timberg
78e78256a5 Cache the lineheight regex (#8240) 2020-12-28 10:19:16 +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
04c45aacda Make PointLabels color scriptable (#8194) 2020-12-18 12:36:38 -05:00
Jukka Kurkela
b2d5a5fa97 Update defaults and types for tick stroke (#8195) 2020-12-18 12:36:18 -05:00
UrielMaD
92646a973d Radius validation for drawRadiusLine (#8191) 2020-12-18 12:35:13 -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
Jukka Kurkela
979cd4131b Fix legend alignment issues (#8168) 2020-12-15 08:50:13 +02:00
Jukka Kurkela
e78310c0fd ArcElement: Skip draw when radius is negative (#8170) 2020-12-14 17:13:03 -05:00
Jukka Kurkela
8ab62f57be Use correct color for legend labels (#8167)
* Legend colors fallback
* Update test
2020-12-14 16:08:40 -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
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
e268845c7b Quick exit the legend fit function when the legend is not displayed (#8161)
When the legend is not displayed, there are no guarantees that the
format of the options dictionary is correct. Rather than performing
computations and then exiting without using the results, we can instead
exit quickly since the size of the legend will be (0, 0) if not displayed
2020-12-14 12:04:10 +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
Evert Timberg
649f815328 Respect the set locale for in the pie/doughnut tooltips (#8142) 2020-12-06 18:17:22 -05:00