Commit Graph

1044 Commits

Author SHA1 Message Date
Akira Aso
16f6b8cb41
Fix a typo in data-structures.md (#10259)
Change `The provides labels can be` to `The provided labels can be`.

Co-authored-by: Akira Aso <44665462+akiorange@users.noreply.github.com>
2022-03-31 08:08:21 -04:00
Jacco van den Berg
4c42bd0919
Correct chart initialization flow (#10266)
* update flow chart to reflect correct flow

* Update drawio file
2022-03-31 08:08:00 -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
Jacco van den Berg
9568a315d2
Update link to filler plugin (#10250) 2022-03-20 19:59:12 -04:00
Adam Parkin
6a6693e26d
Update animations.md (#10184)
Fix broken link to animations sample.
2022-02-22 08:37:33 -05:00
Jacco van den Berg
6c129267f8
remove hardcoded licenseYear in docs (#10158) 2022-02-14 04:26:22 +02:00
Jacco van den Berg
c80b1450f5
update link to license and bump license year (#10156)
* update link to license and bump license year
* another license year bump
2022-02-13 11:27:29 -05:00
Evert Timberg
759a56c3a5
Document scale update plugin hooks (#10154) 2022-02-13 10:22:12 -05:00
Jacco van den Berg
ed68557a99
Make object notation usable for polarArea and radar (#10088)
* start to make object notation usable for polarArea
* enable object notation also for radar chart, test default key
2022-02-12 10:23:31 -05:00
Talla2XLC
7c14ab74aa
Add new align 'inner' for X axis (#10106)
* Add new align for X axis

new align 'left-right' for options.scales['x'].ticks namespace will allow users to aling ticks: 'start" for first (left) tick and 'end' for last (right) tick

* corrected name of aligment to "inner", documentation and add test for inner labels

* delete unnecessary changes

* corrected logic for reverse axis, add tests for reverse axis and withoutY axis

* corrected chart paddings for "inner" tick align

* code clearness

* Update types/index.esm.d.ts

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

Co-authored-by: Talla2XLC <alexey.ivanov@epc.com.ru>
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
Co-authored-by: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
2022-02-12 10:07:00 -05:00
Jacco van den Berg
7d3a1b874c
Sort docs sub menus alphabetically, add line and plugin sample (#10138)
* add sample plugin for doughnut empty state

* Add commented out sample, order sub cats alphabetically
2022-02-06 15:11:53 -05:00
Evert Timberg
cb81592989
Allow spanGaps to be specified on LineOptions (#10133) 2022-02-06 15:11:02 -05:00
stockiNail
56661e448d
Sort line and bubble dataset options alphabetically (#10100)
* Sort line and bubble dataset options alphabetically
* moves drawActiveElementsOnTop to general section
2022-02-01 07:50:19 -05:00
Dimitri Papadopoulos Orfanos
a7d98fb1a0
Fix typos found by codespell (#10103) 2022-01-27 09:24:55 -05:00
Jacco van den Berg
4d918f5afa
add typing and docs for maxTicksLimit all scales (#10057)
* add typing and docs for maxTicksLimit time scale

* change maxTicksLimit to base  instead of each scale seperatly since its done in the core.scale
2022-01-11 15:57:35 -05:00
Cyril Auburtin
cb1fd3fca7
typo Cofiguration (#10045) 2022-01-04 11:43:59 -05:00
Jacco van den Berg
2970e70858
Docs/Add sample for centered point labels (#10013)
* Add sample for centered point labels

* update chart title

* link to sample for more clarity from property
2021-12-22 15:59:58 +02:00
t-mangoe
961533c115
Add centerPointLabels option for linear radial scale (#9949)
* center point labels to slices in polar chart

* remove unnecessary comments

* put the code together in one line

* fix the code according to the code review

* Undo changes related to the createContext function

* add documentation and types.
2021-12-21 20:27:07 +02:00
Doug Brunner
977a4b8d85
Docs/clarify usage of ticks callback (#9991) (#9994)
* Docs/clarify usage of ticks callback (#9991)

* Docs/Fixed inconsistent variable names (#9991)

Co-authored-by: Doug Brunner <doug@epicycloidengr.com>
2021-12-16 07:34:30 -05:00
Jacco van den Berg
30bebefc40
Types/ type suggestedMin and suggestedMax for time scale (#9986)
* type suggestedMin and suggestedMax for time scale

* implement feedback
2021-12-14 13:41:47 -05:00
Jacco van den Berg
0a5c058d7a
Types/Allow min-max as string timescale (#9985)
* allow for string in time scale min max config

* add min-max type to docs

* typo
2021-12-14 11:50:37 -05:00
Jacco van den Berg
4a9f446ff5
Docs/clarify samples (#9960)
* add information to the samples root about using the samples

* Implement review feedback
2021-12-06 07:39:33 -05:00
Josh Kelley
d83f0467da
Improvements to tooltip positioners (#9944)
* Improve positioner types; allow overriding xAlign and yAlign

* More type improvements; pass in Chart as third parameter

* Expose chart as part of TooltipModel

I initially passed the Chart element as the third parameter to the positioner; however, Scale and LegendElement elements expose `this.chart`, and sample code for positioners used `this._chart`, so documenting the chart member and giving it a public name seems to make more sense.

* Update documentation

* Fix documentation

* Fix issues from code review
2021-12-06 07:39:06 -05:00
Jukka Kurkela
4ac11a7208
Try to improve documentation for new users (#9952)
* Try to improve documentation for new users
* Review update
2021-12-05 12:42:52 -05:00
Jacco van den Berg
e7aec8c301
add beforeDestroy hook (#9933)
* add `beforeDestroy` hook
* add documentation of destroy lifecycle, add `afterDestroy` hook and deprecate destroy
2021-12-05 09:05:18 -05:00
Luuk de Vlieger
7784fbfded
Support "r" axis for non-intersecting interaction (#9919)
* Support "r" axis for non-intersecting interaction

* Extract some interaction functionality

* Remove whitespace and semicolons

* WIP: add interaction test

* Update documentation

* Fix test

* Add another test

* Update axis params

* Add additional axis check to binary search

* Update axis type
2021-12-05 08:57:07 -05:00
Jacco van den Berg
6d3a1c5fa6
Feature/active elements on top (#9920)
* add flag to draw active items on top

* add documentation and types

* remove redundent check

* added test

* resolve linting errors

* increase tollerance

* remove axes for better test, hope no tolerance needed
2021-12-05 08:56:53 -05:00
Jukka Kurkela
cd9d5289a4
Add borderJoinStyle option for arc elements (#9877)
* Add borderJoinStyle option for arc elements
* docs + types
* Consistently enumerate the possible choices
2021-12-05 08:56:37 -05:00
Jukka Kurkela
42e85942a8
Add notes about more specific options for axes (#9923) 2021-11-30 07:43:46 -05:00
carsonalh
5e5339d01c
Update stale documentation for axis titles (#9683)
* Update stale documentation for axis titles (#9682)

Updated the documentation for the types on axis labels.

In the corresponding `index.esm.d.ts` file, put JSDoc descriptions for
the properties to match the now-updated documentation.

* Clean up axis title labels documentation (#9682)

Inserted extra information in the documentation for the type of the
padding, inserted missing full stops.

In the type file, added JSDoc for undocumented properties.

* Update docs/axes/labelling.md

* Update types/index.esm.d.ts

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2021-11-29 23:37:34 +02:00
Dmitriy Fishman
1107073a98
Fix a typo in index.md (#9900)
Fix a typo
2021-11-25 08:19:26 -05:00
Dmitriy Fishman
26ca35f8b4
Update contributing.md (#9893) 2021-11-25 08:10:12 -05:00
Igor Lukanin
51762aece5
docs: Add a link to front-end integrations (#9866) 2021-11-17 18:04:22 -05:00
Jukka Kurkela
6bc47d3cea
Update misleading sample comment (#9865) 2021-11-17 07:34:00 -05:00
Jacco van den Berg
681ada552e
Docs/update scale position type (#9812)
* update type of scale position in docs, add explanation sentence to object position

* improve clarification

* grammar/spelling
2021-11-07 21:31:31 +02:00
Eric Theise
67c5a85144
Define with let to avoid "assignment to constant" errors (#9803)
* Define with let to avoid "assignment to constant" errors

Thanks for this example. Defining `label` with `const` rather than `let` results in `Uncaught TypeError: Assignment to constant variable.`

* Another case where const needs to be replaced with let.

* Requested cases where const needs to be replaced with let +1 (style).
2021-10-30 09:23:14 -04:00
Jukka Kurkela
2a97192154
New sample: Progressive Line With Easing (#9798) 2021-10-26 07:49:04 -04:00
Jacco van den Berg
9039053049
change namespace and chart types that override legend defaults (#9791) 2021-10-25 19:48:51 +03:00
Evert Timberg
2f4962f750
Add warning about chart types overriding plugin defaults (#9787) 2021-10-24 12:14:37 -04:00
mikidoodle
6c220748db
Fixed 4 links (#9720)
* Update linear.md

* Update padding.md

* Update padding.md

* Update padding.md

* Update padding.md

* Update padding.md

* Update padding.md

* Update padding.md

* Update padding.md

* Update padding.md

* Padding.md links work now

* Decimation plugin links work now

* Three links work now

I’ve made the Specify a rotation value and ticks.sampleSize links work.

* Update linear.md
2021-10-15 22:36:53 +03:00
PrashoonB
6f7e09540c
Changed var to const/let in the docs (#9744)
Changed var to const/let in the docs
2021-10-13 14:51:33 -04:00
0xflotus
28de4b00dc
docs: fix small error (#9724) 2021-10-05 18:55:42 -04:00
Jukka Kurkela
e1ae5e6abf
Add layout.autoPadding option (#9716) 2021-10-04 14:01:10 -04:00
Evert Timberg
a21c1c6dfa
Document sample components file (#9697) 2021-10-01 19:27:54 +03:00
Jukka Kurkela
c3a53f06d7
Bar: fix too thick borders (#9678) 2021-09-25 07:52:03 +03:00
Jukka Kurkela
990a2890d5
Fix some typings issues (#9680)
* Types: Add scope to ticks.callback

* Fix some typings issues
2021-09-24 18:13:53 -04:00
Jukka Kurkela
183a1a9f67
Fix segment styling with gaps (#9644) 2021-09-13 16:31:34 -04:00
Evert Timberg
f5c9a656ef
Configurable tooltip box padding (#9625) 2021-09-06 09:13:21 -04:00
Iurii Golskyi
eab0554717
fix: broken link to cubicInterpolationMode (#9626)
* fix: broken link to `cubicInterpolationMode`
Elements -> Line configurations -> cubicInterpolationMode
* fix: broken link in Line Configuration
2021-09-05 16:31:00 -04:00
Evert Timberg
71fa55acac
Add parsing support to pie/doughnut charts (#9622) 2021-09-05 13:46:26 -04:00