Commit Graph

116 Commits

Author SHA1 Message Date
Jukka Kurkela
a4231486eb
helpers.curve cleanup (#8608)
* helpers.curve cleanup
* Use distanceBetweenPoints
2021-03-10 09:32:54 -05:00
Jukka Kurkela
0c838432fc
Disable warning of unused variables in types/tests (#8607) 2021-03-10 08:13:04 -05:00
Evert Timberg
275fdaf3da
Expose radial scale point label positions (#8588) 2021-03-07 16:58:45 -05:00
Jukka Kurkela
160534f913
Add 'single' mode for stacking (#8586)
* Add `'single'` mode for stacking

* Update fixture
2021-03-07 10:52:31 -05:00
Jukka Kurkela
8d6e87881a
Relocate chart type and dataset type defaults (#8563)
* Relocate chart type and dataset type defaults

* Update types

* Separate overrides and descriptors

* Update derived sample, use merge for inherit

* Don't merge overrides

* Review update
2021-03-06 10:34:52 -05:00
Evert Timberg
279b6ae1da
Enable multi-line axis titles (#8579) 2021-03-06 10:18:32 -05:00
Evert Timberg
a23f1de6df
Rename scaleLabel to title in scale options (#8576) 2021-03-05 23:22:55 -05:00
Evert Timberg
91628c1449
Tooltip specific scriptable context (#8561)
* Update plugin to use it's own tooltip context

* Scriptable tooltip option types

* Tests

* Update types to use UnionToIntersection

* Update TooltipItem to use UnionToIntersection
2021-03-04 08:25:24 -05:00
Jukka Kurkela
413b04ffa6
Types: Update ScriptableContext (#8556)
* Types: Update ScriptableContext
* Add data array type test
2021-03-02 07:41:17 -05:00
Jukka Kurkela
d9a2f845f8
Types: Update LayotPosition (#8555) 2021-03-02 07:39:05 -05:00
Jukka Kurkela
3460ef126e
Types: Add couple of tests, move utils to new file (#8526) 2021-02-26 16:29:10 -05:00
Jukka Kurkela
bb82aaa320
Update types so instance can be assigned to a variable of type Chart (#8525)
* Update types
* Remove outdated comments
2021-02-25 19:06:32 -05:00
Jukka Kurkela
12e9020ab7
Remove unused getRingIndex from Doughnut (#8521) 2021-02-24 18:13:51 -05:00
Jukka Kurkela
b06cd36697
Rename cutoutPercentage to cutout + chores (#8514) 2021-02-24 16:58:01 -05:00
Jukka Kurkela
e55a12ce87
Add linting of type tests (.ts) + fix errors (#8505) 2021-02-23 11:41:00 -05:00
Jacco van den Berg
36966a46c7
update borderskipped typing (#8503) 2021-02-23 13:58:53 +02:00
Evert Timberg
8c1cca280d
Document stacked parse data (#8491) 2021-02-22 19:55:26 +02:00
Evert Timberg
8c4e862a2c
Merge tooltip padding settings (#8493) 2021-02-22 08:30:25 +02:00
Jukka Kurkela
65bfacd9a5
Add outerRadius option to doughnut/pie (#8487) 2021-02-21 17:30:37 -05:00
Evert Timberg
b27a4608cc
Document the fullSize property of the title plugin (#8488) 2021-02-21 23:25:03 +02:00
Evert Timberg
aa69892823
Provide a chart-type specific definition for ParsedData (#8480)
* Provide a chart-type specific definition for ParsedData
* Fix lint error
* Code review feedback
2021-02-21 13:10:19 -05:00
Kashif Shamaz
832bf9144a
Added 'hidden: boolean' to ControllerDatasetOptions type and documented the field's usage in Dataset configuration section (#8478) 2021-02-21 18:17:01 +02:00
Jacco van den Berg
9f071b0f23
Update index.esm.d.ts (#8472)
* Update index.esm.d.ts

tickValue is to my knowledge always a number or a string so this will make it so people wont have to parse it themselfs

* Update core.scale.js

Update typedef according to types update
2021-02-21 09:16:11 -05:00
Evert Timberg
5c9e1d578c
LTTB Decimation (#8468)
* LTTB Decimation
* Lint fixes
2021-02-21 09:15:45 -05:00
Jukka Kurkela
def8d25d4b
Fix animation types, add test (#8476) 2021-02-21 09:15:26 -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
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
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
Evert Timberg
b036b7ba92
Provide a method to quickly register all imports in ESM builds (#8425) 2021-02-15 11:21:31 +02:00
Jukka Kurkela
ddfbcf777a
Update eslint-config-chartjs to v0.3.0 (#8406) 2021-02-10 08:21:39 -05:00
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
90758950ad
Update ScriptableContext, reduce warnings (#8390)
* Update ScriptableContext, reduce warnings

* _parsed is unknown[]

* Add defaults

* static defaults.

* review update

* more cancelables
2021-02-05 19:59:55 -05:00
LeeLenaleee
22ca8af1cd
Fix/type dateadapter override (#8377)
* Not totally sure this is right , but since in core.adapters.js override is part of the dateadapter it seems logical it should be there. Should also fix #8369
* implemented feedback
* Declare the dataAdapter since it will be available at runtime if someone overrides it
* remove declaration. if this is giving problems in the future it might need te be added again
2021-02-05 19:15:35 -05:00
Jukka Kurkela
6e56ae64f7
Update types for indexAxis (#8389)
* Add indexAxis to CoreChartOptions
* Update types for indexAxis
2021-02-05 17:39:45 -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
Evert Timberg
49b0916c19
Update type map names (#8356)
* Rename ElementOptions to ElementOptionsByType

* Rename CommonOptions to CommonElementOptions

* Rename PluginOptions to PluginOptionsByType
Add new PluginChartOptions and remove some duplicates

* Rename ScaleOptions to ScaleOptionsByType

* Use Partial where appropriate
2021-02-01 08:38:37 -05:00
Jukka Kurkela
ad84d285d8
Rename LayoutItem.fullWidth to fullSize (#8358) 2021-01-31 13:44:44 -05:00
Josh Kelley
5eb3682b9f
Give elements their own interface definition (#8290)
From what I understand, if we want to allow registering additional element options (see [here][1] for an example), then the element options need to be a top-level interface so that they can be used with TypeScript's [declaration merging][2].

[1]: https://github.com/chartjs/chartjs-plugin-annotation/pull/275#issuecomment-742754562
[2]: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
2021-01-30 14:48:18 -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
Jukka Kurkela
3c64bc88e8
Doughnut: complete radians to degrees conversion (#8321) 2021-01-16 16:04:48 -05:00
LeeLenaleee
a58d43cbda
fixes #8304 (Missing type) beta 8 broken typescript (#8305)
* fixes #8304

* Update layout.d.ts

First letter of variable from capital to normal
2021-01-14 07:45:12 -05:00
Josh Kelley
fa375ff448
Update TypeScript ESLint configuration (#8288)
Using TypeScript-specific ESLint rules fixes some spurious ESLint warnings.
2021-01-08 16:01:20 -05:00
Jukka Kurkela
81a1e9a95e
Add type linting (#8264) 2021-01-05 07:23:30 +02:00
Ben McCann
4f7179a626
Standardize type declaration indentation with tabs (#8263) 2021-01-02 08:46:49 +02:00
Jukka Kurkela
d00ffdcd76
Tooltip: Render when animations are disabled (#8252) 2020-12-30 08:33: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
f44db35e2e
Clean up the LayoutItem type (#8235) 2020-12-26 16:22:55 -05: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
55dd7ded0e
Remove duplicate Scriptable definitions (#8223) 2020-12-22 13:10:25 -05:00