Commit Graph

291 Commits

Author SHA1 Message Date
Dan Onoshko
51441272a7
refactor: move to esm in sources (#10879) 2022-11-17 08:08:44 -05:00
Jacco van den Berg
53b79673eb
Remove type attribute from dataset specific type specification (#10869) 2022-11-13 19:36:25 +02:00
Lucca Miranda
24745fac51
refactor: migrate helpers.options to typescript (#10753)
* refactor: migrate helpers.options to typescript

* chore: nitpicks
2022-11-04 11:17:09 -04:00
Igor Lukanin
1c2f66a00e
Introduce Colors plugin (#10764)
Introduces a colors plugin that provides a color palette

Co-authored-by: Dan Onoshko <danon0404@gmail.com>
Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
2022-10-21 08:21:08 -04:00
Evert Timberg
c338942ebb
Convert the Arc element to TS (#10772)
* Convert the Arc element to TS

* Make max-statements and complexity warnings in TS files as well

* Increase size limit

* Update src/elements/element.arc.ts

Co-authored-by: Dan Onoshko <danon0404@gmail.com>

Co-authored-by: Dan Onoshko <danon0404@gmail.com>
2022-10-12 07:08:37 -04:00
Lucca Miranda
b0160e138a
refactor: migrate helpers.dom to typescript (#10734) 2022-10-09 09:21:12 -04:00
Evert Timberg
41612d1320
Convert the curve helpers to TS (#10733)
* Convert the curve helpers to TS
* Remove old type
2022-10-07 08:28:24 -04:00
Evert Timberg
06bbadb00f
Convert the PointElement to TS (#10730)
Co-authored-by: Chart.js <>
2022-10-07 08:28:03 -04:00
Brainshaker95
813943ac72
Types: Change grid option of CartesianScaleOptions and RadialLinearScaleOptions to Partial of GridLineOptions (#10760) 2022-10-07 07:36:57 +03:00
Jacco van den Berg
72b185afa6
Allow to configure X and Y axis ID in TS for bubble charts (#10739)
* Update namespace

* Allow for x and y axisId to be passed to bubbledataset controller
2022-10-06 22:41:51 +03:00
Evert Timberg
e6892a92cb
Convert helpers.extra to TS (#10728)
Co-authored-by: Chart.js <>
2022-10-06 15:37:42 -04:00
Evert Timberg
740ae60db0
Export declare const enums (#10729)
Co-authored-by: Chart.js <>
2022-09-30 16:13:35 -04:00
Luciano Santana
6f4b365d8b
Types: Export UpdateModeEnum as const (#10726)
Co-authored-by: Luciano Santana <contacto@lucianosantana.net>
2022-09-30 11:15:59 -04:00
Dan Onoshko
d1e118aea8
refactor: move batch of helpers to ts (#10722)
* refactor: move batch of helpers to ts

* refactor: review fixes
2022-09-30 09:48:12 -04:00
Jacco van den Berg
dea889b980
Add defaults to plugin interface (#10712) 2022-09-27 13:39:48 +02:00
Jacco van den Berg
fbaf28e4f8
Use guard clause typings (#10683)
* Use guard clasue

* use function type instead of build in function
2022-09-27 14:00:48 +03:00
Jacco van den Berg
5f37ba6fc4
Add warning if filler plugin is used but not registered (#10702)
* add warning if filler plugin is used but not registered

* fix lint

* increase size limit

* add test, only put warning in dataset controller

* fix register in docs, remove commented code

* remove other mr

* add documentation

* Apply suggestions from code review

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>

* Also return false if plugin is disabled by options

* improve warning message

* undo docs changes

* update test

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2022-09-26 20:20:54 +02:00
Dan Onoshko
47cb9e1f76
feat: typescript node next support (#10661) 2022-09-14 06:44:57 -04:00
stockiNail
9871aaa262
Use ticks.steSize instead of time.stepSize on time and timeseries scales (#10653) 2022-09-10 18:46:26 +03:00
Dan Onoshko
83a41c2e0c
fix: types and tests (#10660) 2022-09-10 11:36:50 -04:00
Lonylis
21305e2883
Update bar data type to comply with floating bar charts data (#10652)
* Update index.d.ts

Floating bars charts can take an array of array.
https://www.chartjs.org/docs/latest/samples/bar/floating.html

* Update types/index.d.ts

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>

* floating bar chart data validation

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
2022-09-06 09:42:04 -04:00
Dan Onoshko
8ff853c60e
feat: remove default axis override when custom id is given (#10643)
* feat: remove default axis override when custom id is given

* docs: add info into migration guide

* test: fix tests for the feat

* docs: add info into migration guide

* test: fix tests for the feat

* feat: review fixes

* feat: review fixes
2022-09-02 07:52:48 +03:00
Evert Timberg
b95ba3d5c3
Convert the easing helpers to typescript (#10627)
Co-authored-by: Chart.js <>
2022-08-31 09:53:54 -04:00
Dan Onoshko
2031cdf051
Preparing the project for TypeScript (#10595)
* Add Typescript to the build
* Converts the `helpers.core` to Typescript as an example
* Converts the `core.element` to Typescript
2022-08-22 11:58:57 -04:00
Grant Hynd
75793eb86f
fix: allow beforeTooltipDraw to be cancelable (#10598) 2022-08-22 17:33:02 +02:00
Jacco van den Berg
3eb947719e
Put the border opts in own object (#10571)
* put borderOpts in own object

* document z option

* remove todo and change scaleId to id

* update some tests

* clean bit, remove console log

* fix failing test

* lint

* Remove comment
2022-08-18 15:07:46 +02:00
Jacco van den Berg
d09e424a0a
Use borderRadius for legend and remove fallbacks (#10551)
* Use borderRadius for legend

* re enable test

* fix lint

* add note in migration guide

* Update types/index.d.ts

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2022-08-18 07:34:18 -04:00
Jacco van den Berg
dad1e98c5a
Allow animations to be set to false for the tooltip (#10582) 2022-08-18 07:33:42 -04:00
Jacco van den Berg
bd29fcbf67
type grouped option for bar chart (#10590) 2022-08-18 09:16:13 +03:00
Jacco van den Berg
d9203719f6
add correct padding object to type (#10585)
* add correct padding object to type

* Apply suggestions from code review

Add spacing

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
2022-08-18 09:15:50 +03:00
Dan Onoshko
ffce0f9f18
feat: tooltip callbacks fallback (#10567)
* feat: tooltip callbacks fallback

* docs: review fixes
2022-08-18 09:03:12 +03:00
John Williams Metservice
7776d27268
Update index.d.ts (#10579)
Allow nulls to be passed to barChart data to allow datasets to spanGaps.
2022-08-17 18:43:46 -04:00
Jacco van den Berg
3df687a87c
Remove destroy hook (#10549)
* remove destroy hook

* revert package-lock.json changes

* update test

* add migration guide note

* fix karma failing test

* change way of importing package.json
2022-08-05 19:51:14 +03:00
Jukka Kurkela
29395d9013
Fix docs build (#10566) 2022-08-05 08:02:04 -04:00
Dan Onoshko
ce375a6876
feat: add ESM support (#10525)
* feat: add ESM support

* build: rename UMD bundle

* chore: edit supbackages description

* style: disable es/no-import-meta linter rule

* test: dynamic import in cjs module

* docs: edit integrations page

* docs: review fixes

* chore: remove useless regex in webpack config

* ci: test size-limit only for ESM bundle
2022-08-04 18:43:26 -04:00
Jacco van den Berg
9dfaa63639
Move parameter of TType in ChartMeta to first option (#10550)
* move paramter of TType in ChartMeta to first option

* add missing ChartMeta change

* Add note in migration guide
2022-08-04 01:06:15 +02:00
Dan Onoshko
844270eb5e
feat: pass some chart options to DateAdapter (#10528)
feat: pass some chart options to DateAdapter
2022-07-30 11:25:01 -04:00
Slava Terekhov
f0be17c859
Add circular prop to arc element (#10405)
* feat: add circular prop to arc element draw actions
* test: add test for arc element with circular:false prop
* feat: add circular prop to Arc element options
* docs: add decriptiption for new Polar area chart prop
* docs: fix circular prop description
* docs: add info about arc element circular prop to elements docs
* docs: move circular prop from general options to styling
2022-07-30 11:08:38 -04:00
Jacco van den Berg
1fef75d990
Skip all borders if borderSkipped === true (#10530)
* Skip all borders if borderSkipped === true

This will allow you to skip all borders (not just one side) if you set borderSkipped to boolean true and so allow you to have a consistent legend marker even for bars without borders. Reason is that even if same colored borders are set there are artifacts that make the bar look bad and also even with inflateAmount the bars do look good when big but when only a few pixel in size they start to look bad too so this was the only way for me to make it work so legends are looking good and bars too.

* fix failing test, update docs and typings

* update typing comment

Co-authored-by: Istvan Petres <pijulius@users.noreply.github.com>
2022-07-30 08:12:53 -04:00
stockiNail
144a6c0c27
Enable borderDash option in the grid as scriptable (#10519) 2022-07-26 08:28:15 -04:00
Jacco van den Berg
97351d1b5d
update typing of clip, allow it to be configurable in the options for typescript (#10494) 2022-07-20 12:51:22 -04:00
Dominic Jean
5452502b8c
Add pointStyleWidth option for legend (#10412)
* add pointStyleWidth for legend

* add drawPointLegend to keep drawPoint signature
2022-07-18 06:49:08 -04:00
Jacco van den Berg
0312697f38
Add index to legendItem interface (#10436)
* Add index to legendItem interface for doughnut, pie and polarArea charts. Make datasetIndex optional since the before named charts dont include it.

* Remove test to check if datasetIndex has been set in generateLabels function for legend
2022-06-22 09:22:53 -04:00
Jacco van den Berg
f796c7b475
Add padding to pointLabels type, add type to scriptable context (#10404)
* Add padding to pointLabelTypings and add type field to context

* Use correct scriptable helper

* Remove trailing space
2022-06-07 15:59:41 +03:00
Jacco van den Berg
2486fe2b1e
Allow for each dataset to be individually typed without a main type (#10387)
* allow for each dataset to be individually typed without a main type
* fix lint issues
* add extra test cases
2022-05-31 14:01:39 -04:00
Jacco van den Berg
5173d05978
Types: Allow font to be partial scriptable and individually scriptable (#10364)
* allow font scriptable to return partial object and be scriptable
* add other elements as scriptable
* rename variable for context to resolve lint issue
* add duplicate font for non scriptable
* change to scriptableOptions
* fix parameter
* missing space
* Change name of helper function to match other helper function
2022-05-25 07:49:12 -04:00
Yiwen Wang
ebcaff15c2
Add option to include invisible points (#10362)
* Add option to include invisible points

* Minor fixes

* Add doc for newly added option

* Fix typo

* Add test for newly added option

* Improve description of the new option

* Update docs/configuration/interactions.md

Co-authored-by: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>

Co-authored-by: Yiwen Wang 🌊 <yiwwan@microsoft.com>
Co-authored-by: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
2022-05-25 13:25:27 +03:00
Jacco van den Berg
2c268f0943
Resolve canvasGradient is undefined in node (#10328)
* Resolve canvasgradient is not defined in node

* Remove trailing white space

* export isPaternOrGradient helper with typings

* fix lint failure, single qoute

* Allow for string inputs too to function
2022-05-03 08:21:43 -04:00
Evert Timberg
5c3dc932b6
Enable configuration of radial scale point label border radius (#10293) 2022-04-15 18:31:09 -04:00
Jukka Kurkela
4b5ca7f24e
Types: add 'middle' to borderSkipped (#10283) 2022-04-05 18:52:45 +03:00