Commit Graph

31 Commits

Author SHA1 Message Date
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
Dan Onoshko
83a41c2e0c
fix: types and tests (#10660) 2022-09-10 11:36:50 -04: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
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
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
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
Dimitri Papadopoulos Orfanos
a7d98fb1a0
Fix typos found by codespell (#10103) 2022-01-27 09:24:55 -05:00
Jukka Kurkela
2988a6c6dc
Fix type linting and indent errors (#9843)
* Fix type linting and indent errors
* Properly indent comments too
2021-11-11 15:00:52 -05:00
Jukka Kurkela
6a250de81d
Add chart, p0.raw, p1.raw to segment context (#9761)
* Add chart, p0.raw, p1.raw to segment context

* Types
2021-10-15 15:56:29 -04:00
aha-oretama
61e3eca198
fix getRelativePosition type definition (#9610)
* fix getRelativePosition type definition

* Update helpers.dom.d.ts

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2021-09-06 09:14:00 -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
Jukka Kurkela
d661bd788b
Resolve warnings from typings (#9363) 2021-07-09 07:03:11 -04:00
Akihiko Kusanagi
0ba5c70618
Support monotone cubic interpolation for vertical line charts (#9084)
* Support monotone cubic interpolation for vertical line charts

* Use more more intuitive veriable names
2021-05-14 17:07:26 -04:00
Evert Timberg
e29ba78cd1
Allow the events option to be changed at runtime (#8928) 2021-04-17 14:08:36 -04:00
Jukka Kurkela
d79b5a3d60
Add typings for throttled and debounce (#8689)
* Add typings for throttled and debounce
* Review feedback
* args for fn too
* one more
2021-03-21 11:50:28 -04:00
Evert Timberg
375d856a87
Expose formatNumber as a helper (#8683) 2021-03-21 11:04:27 +02:00
Jukka Kurkela
f744c3bde6
Add x/y shorthand for padding options (#8637) 2021-03-14 11:21:30 -04:00
Jukka Kurkela
a4231486eb
helpers.curve cleanup (#8608)
* helpers.curve cleanup
* Use distanceBetweenPoints
2021-03-10 09:32:54 -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
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
Ben McCann
4f7179a626
Standardize type declaration indentation with tabs (#8263) 2021-01-02 08:46:49 +02: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
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
75fcd4fffa
Split geometric types to their own definition file (#8202)
* Split geometric types to their own definition file
* Re-export types
2020-12-19 13:39:35 -05:00
Evert Timberg
a182cbed7b
Merge TS files into a single file to prevent circular loops (#8198) 2020-12-19 10:37:33 -05:00
Evert Timberg
17f6edb650
Remove I prefix from TS types (#8017)
* Remove I prefix from TS types
* Update missing `ILayoutItem` typedefs
* IEvent should become ChartEvent
* Prevent FillTarget collision
* Import FontSpec instead of IFontSpec
* Prevent recursive DateAdapter problem
2020-11-07 08:35:19 -05:00
Samuel Gratzl
391e4b6f2e
flat helpers (#7806)
* generate a flat helpers package
* move helpers built files to dist
* upgrade docs for flat helpers
2020-09-28 09:11:55 -04:00
Jukka Kurkela
10f393a58d
Fix: maximum size and mouse position with styling (#7816)
Fix: maximum size and mouse position with styling
2020-09-26 13:18:35 -04:00
Samuel Gratzl
886a465c18
small type fixes (#7715) 2020-08-19 07:01:14 -04:00
Samuel Gratzl
4eeed6e876
WIP: TypeScript types (#7668)
First version of types
2020-08-04 16:52:57 -04:00