Commit Graph

242 Commits

Author SHA1 Message Date
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
Dan Onoshko
a4de430d99 fix: treeshaking (#10504)
* fix: treeshaking
* refactor: DatasetController.datasetElementType and DatasetController.dataElementType as static props
2022-08-04 09:17:40 -04:00
Jukka Kurkela
9224e57d93 Add integration test(s) for Node (#10554) 2022-08-03 09:17:05 -04:00
Jacco van den Berg
7079a1caac Bump to 3.9.0 (#10541)
* make link work in github itself
* fix dead link on reload or new tab
* bump to 3.9.0
2022-08-02 08:54:45 -04:00
Ben McCann
6feb48b5ef Allow ESM files to be used in Node.js (#10479)
Allow ESM files to be used in Node.js
2022-07-30 11:25:23 -04:00
Evert Timberg
26e70b7608 Explicitly include package.json files for subpackages (#10513)
Remove redundant permissions on release CI to prevent a failure
Bump version to v3.8.2

Co-authored-by: Chart.js <>
2022-07-24 14:42:33 -04:00
Evert Timberg
aa4507d222 Bump to 3.8.1 (#10509) 2022-07-24 11:38:49 -04:00
Jacco van den Berg
3fe5811648 Lint before build & test, remove lint from test (#10462)
* Lint before build & test, remove lint from test
* should reconize test now
* test skip build in test step
* readd build step
2022-07-07 07:15:54 -04:00
Jacco van den Berg
1a1151b122 Bump to 3.8.0 (#10377) 2022-05-25 10:06:57 -04:00
Evert Timberg
cf780a5db5 Update to v0.2.1 color dependency to fix bug with invalid colours (#10371)
* Update to v0.2.0 color dependency to fix bug with invalid colours
* v0.2.1
2022-05-23 12:51:17 -04:00
Josh Kelley
c057c96693 Interaction functions (#10046)
* Refactor get...Items functions to take events rather than positions

To work toward exposing something like the get...Items functions.

* Switch getAxisItems to use optimizedEvaluateItems

optimizedEvaluateItems falls back to evaluating all items for unsorted items, and sorting / optimizing ought to be okay, so this ought to be equivalent.

* Performance

* Consolidate getRelativePosition

helpers.dom.js's getRelativePosition already had logic to handle ChartEvent vs. Event (as demonstrated by the `native` check within `getCanvasPosition`), so it's redundant for core.interaction.js to have its own `native` check.

Update `getRelativePosition` to use the same `native` check as core.interaction.js's version.  As best as I can tell, the ChartEvent's x and y are populated from `getRelativePosition`, so the previous `getCanvasPosition` was effectively just duplicating `getRelativePosition'`s work.  I added a test to verify this; it depends on a local, not-yet-submitted change in chartjs-test-utils' `triggerMouseEvent` to return the mouse event that it triggers.

* Add an API to refactor duplicate isPointInArea

* Rename and update JSDoc to prepare for making this public

* Give functions a consistent, generic interface

* Export functions for discussion

* Code review feedback

Add a non-null assertion, as requested in code review.

Add JSDoc to clarify that `getCanvasPosition` now expects a native `Event`, not a `ChartEvent`.  Add `@ts-ignore`; `getCanvasPosition` relied on some loose conversions between `Event`, `TouchEvent`, and `Touch` that would require several changes to make TypeScript happy.

* Code review feedback

Return the event directly, to speed up the code a bit.  Add JSDoc to help communicate its intent.  Update various comments.

* Finalize exports; add docs and TypeScript

* Update src/helpers/helpers.dom.js

* Update src/helpers/helpers.dom.js

Only thing needed actually is the update of chartjs-test-utils to 0.4.0

* Bump chartjs-test-utils dependency

To get supporting work from https://github.com/chartjs/chartjs-test-utils/pull/19

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2022-03-24 09:02:30 -04:00
Evert Timberg
7b621d725d Bump to 3.7.1 (#10148) 2022-02-12 09:48:34 -05:00
Jukka Kurkela
a5b46a859c Bump version to 3.7.0, update deps (#10011)
* Bump version to 3.7.0, update deps

* Fix issues from updated packages
2021-12-23 20:55:39 +02:00
Josh Kelley
957ca837d5 Specify UTC time zone for the test suite (#9945)
The controller.bar/not-grouped/on-time test was failing on my computer because the date ranges happen to cross the end of Daylight Saving Time in the U.S., so chart was generated with one more hour of time than the test fixture expected.

Using moment-timezone to specify a fixed time zone with no DST seemed like the most robust fix. (Alternatively, I could pick a date range that doesn't change DST; that ought to work.)
2021-12-06 07:38:39 -05:00
Jukka Kurkela
9fa26f9247 Bump version to 3.6.2 (#9953) 2021-12-05 08:41:45 -05:00
Evert Timberg
688cd470e9 Bump to 3.6.1 (#9929) 2021-11-30 13:14:49 -05:00
Evert Timberg
40e88ba45c Bump to 3.6.0 (#9784) 2021-10-23 13:21:28 -04:00
Jukka Kurkela
50ad1637b0 Fix plugin event filtering of renamed events (#9613) 2021-09-04 13:41:47 -04:00
Jukka Kurkela
3ed94559dd Add missing typings of helpers, add automatic test (#9570)
* Add missing typings of helpers, add automatic test

* Add error handling to autogen.js
2021-09-01 20:27:26 -04:00
Evert Timberg
4bf42f4e8e Update to 3.5.1 version number (#9565) 2021-08-18 08:12:37 -04:00
Jukka Kurkela
a8337a32c9 Bump version to 3.5.0, update deps (#9464) 2021-07-25 07:56:33 -04:00
Jukka Kurkela
c73add9d6c Typescript 4.2+ compatibility (#9444) 2021-07-20 07:55:51 -04:00
Jukka Kurkela
dac7101131 Bump version to 3.4.1 (#9350) 2021-07-04 07:29:42 -04:00
Jukka Kurkela
28d6619555 Update deps (#9349) 2021-07-04 07:27:00 -04:00
Evert Timberg
4bdb57df8c Bump to version 3.4.0 (#9322) 2021-06-26 12:04:20 -04:00
Jukka Kurkela
54da5341f1 Docs: Add copy button to code blocks (#9262) 2021-06-13 07:40:51 -04:00
Evert Timberg
5082d13d5a Version bump to 3.3.1 (#9182) 2021-05-29 17:35:57 -04:00
Jukka Kurkela
0d6fa55714 Bump version to 3.3, update dependencies (#9149) 2021-05-24 07:49:10 -04:00
Jukka Kurkela
7265bb51d5 Update chartjs-test-utils and mis-sized fixtures (#9135) 2021-05-20 14:59:55 +03:00
Evert Timberg
e344c75eb8 Upgrade dependencies (#9102) 2021-05-15 08:14:23 +03:00
Jukka Kurkela
938865f67d Bump version to 3.2.1 (#9014) 2021-05-01 14:04:59 -04:00
Evert Timberg
0f1d07a1cd Bump to version 3.2.0 (#8974) 2021-04-24 16:12:18 -04:00
Evert Timberg
c56cdedece Bump to 3.1.1 (#8927) 2021-04-17 07:50:47 -04:00
Jukka Kurkela
ef3a777e6b Update @simonbrunel/vuepress-plugin-versions (#8882) 2021-04-11 13:47:38 -04:00
Evert Timberg
981eff5553 Bump to 3.1.0 (#8878) 2021-04-10 16:13:47 -04:00
Jukka Kurkela
05ba2eedff Add version menu in documentation (#8866)
* Add version menu in documentation
* Use filters for tags
* Use limit
* Update
* Use released plugin
* use published version
2021-04-10 16:10:59 -04:00
Jukka Kurkela
5b4aad746f Update dependencies (excluding typescript) (#8856) 2021-04-08 18:03:14 -04:00
Jukka Kurkela
98e890cc7b Patch: option scope might not be an object (#8789) 2021-04-02 16:13:36 -04:00
Evert Timberg
8780e15c73 v3.0.0 version bump (#8781)
* v3.0.0 version bump
* Update urls for next -> latest
* Remove TS urls
2021-04-02 14:56:54 -04:00
Evert Timberg
678974654b Vuepress HTML redirect for samples folder (#8785)
* HTML redirect using vuepress plugin

* Add other needed redirects

Co-authored-by: Evert Timberg <--global>
2021-04-02 20:33:56 +03:00
Jukka Kurkela
48f2039ac1 Add vuepress-plugin-flexsearch (#8784) 2021-04-02 11:18:53 -04:00
Evert Timberg
eef5c1ebf3 Bump to v3.0.0-rc.7 (#8779) 2021-04-02 09:32:59 -04:00
Evert Timberg
d4cb431b84 Remove old sample files (#8777)
* Remove old sample files

* Code review feedback

* Add sample redirect
2021-04-02 09:10:03 -04:00
Evert Timberg
66ee0fecaf Vuepress samples (#8756)
* Generate API docs with vuepress-plugin-typedoc

* Links, fixes, cleanup

* Convert bar samples to Vuepress

* Some line chart samples moved over

* Fix lint issues

* Derived axis type sample

* LineAreaStacked chart created in vuepress

* added radar area axample

* Line dataset added sample

* final area example added

* Add derived-chart-type

* Bar scriptable sample

* Scriptable samples

* Clean lint errors

* added linear axis samples to vuepress

* change tab to spaces to fix lint error

* Convert the rest of the scale samples

* Scale option samples

* Fix typo

* Fixes

* Legend samples

* Title samples

* Change the title of the tip block to Note (#8758)

* Convert bar samples to Vuepress

* Some line chart samples moved over

* Fix lint issues

* Derived axis type sample

* LineAreaStacked chart created in vuepress

* added radar area axample

* Line dataset added sample

* final area example added

* Add derived-chart-type

* Bar scriptable sample

* Scriptable samples

* Clean lint errors

* added linear axis samples to vuepress

* change tab to spaces to fix lint error

* Convert the rest of the scale samples

* Scale option samples

* Fix typo

* Fixes

* Legend samples

* Advanced samples

* Remove extra section

* Animation samples

* Hide legend from progressive line

* Add a comment on what `from` does

* Tooltip samples

* Ädd other charts to vuepress samples

* enable plugin again since all samples have been converted

* fix skip radar example, middle skip was not calculated correctly

* lint error

* Progressive-line: add 2nd line

* Fix lint errors

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
Co-authored-by: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
2021-04-02 08:04:39 -04:00
Jukka Kurkela
93e07ebb48 Generate API docs with vuepress-plugin-typedoc (#8755)
* Generate API docs with vuepress-plugin-typedoc

* Links, fixes, cleanup
2021-03-30 16:19:59 -04:00
Evert Timberg
ed2b96eeaf Switch docs to Vuepress to match other chart.js repositories (#8751)
* Initial work

* Update doc commands

* Updated sidebar config

* Move docs

* Update theme version and enable

* Convert to chart.js sample

* Update scripts to point to local build

* Chart.js from local build

* Simplify getting-started example

* Axis docs updated except for imported content

* Common ticks import works

* Chart type docs ported to editor plugin

* Last pages to use editor

* Fix small errors

* Frontmatter title to heading

* Remove duplicate example

* Update sidebar

* Add paths

* Remove paths

* Add getting-started back

* Update menus and add copyright to license section of the docs

* Add GA plugin

* Style sub-groups

* Remove unneeded license page since it is covered on the main page

* Remove docusaurus readme page

* Remove docusaurus files

* Fix issues in docs

* Build and deploy scripts for docs work

* Conditional base URL for nice local testing

* Use eslint-plugin-markdown

* Remove hard coded lines

* Remove mentions of docusaurus

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2021-03-30 10:32:39 -04:00
Jukka Kurkela
c76ee82461 Bump version to 3.0.0-rc.6 (#8742) 2021-03-27 17:32:59 -04:00
Evert Timberg
04d67aaf8c Point to correct type file & bump (#8724) 2021-03-25 18:03:05 -04:00
Jukka Kurkela
658749f707 Bump version to 3.0.0-rc.4 (#8721) 2021-03-25 17:34:31 -04:00
Josh Kelley
3671c01c26 Distribute types as is (#8720)
I had initially seen some oddities around type augmentation for type definitions in subdirectories of `types`, and using Rollup seemed to help with that. However, now that all of Chart.js's main types are directly under `types`, there seems to be no need for this.

This simplifies the build process, since it no longer needs to use rollup-plugin-dts.

It also improves some third-party tools. For example, I'm in the habit of using WebStorm's "Go To Declaration or Usages" hotkey with third-party TypeScript definitions as a quick way of getting more information about an API. With the Rollup-generate types, that works poorly; WebStorm goes to the imported-and-re-exported symbol within the barely-readable machine-generated dist/chart.esm.d.ts file, and I have to navigate two more hops to find the actual definitions.
2021-03-25 15:08:00 -04:00