Commit Graph

333 Commits

Author SHA1 Message Date
Jacco van den Berg
2a03e138e9 Fix backdrop padding (#11577)
* fix for alignment inner

* Add test

* Remove eslint ignores

* remove unecesarry config

* Remove text from test
2023-11-10 00:25:36 +01:00
Dan Onoshko
1324672637 refactor: rewrite canvas helpers to ts (#11100)
* refactor: rewrite canvas helpers to ts

* refactor: review fixes

* refactor: rm src/helpers/types.ts temporary entry point
2023-02-15 09:26:49 -05:00
stockiNail
8dfcf1c443 Use maxTicksLimit option to calculate the labels size on ticks (#11069)
* Use maxTicksLimit option to calculate the labels size on ticks

* apply review
2023-02-09 09:26:11 -05:00
Dan Onoshko
ae264e14e7 add getLabelItems public method (#10966) 2022-12-16 07:36:14 +01:00
Dan Onoshko
51441272a7 refactor: move to esm in sources (#10879) 2022-11-17 08:08:44 -05:00
Jonatan
f5cb133551 fix: label text not centered when applied rotation (#10773)
* fix: label text not centered on tick when rotated

#10485

* fix: label text not centered on tick when rotated

#10485
2022-10-17 21:28:31 +03:00
cmcnulty
fbf3427ca2 Fix #10749 - backdrops with rotated labels (#10759)
* Fix #10749 - backdrops with rotated labels

* remove translation adjustment
Because backdrop now occurs after translation, we don't want to double-adjust the position.

* increase tolerance slightly due to anti-aliasing

Co-authored-by: Charles McNulty <charles.mcnulty@tasconline.com>
2022-10-12 07:08:22 -04:00
Dan Onoshko
83a41c2e0c fix: types and tests (#10660) 2022-09-10 11:36:50 -04: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
Dan Onoshko
cdb17d6eeb feat: sideEffects false (#10526)
* feat: sideEffects false
* refactor: apply defaults by pure way
2022-08-06 08:45:41 -04:00
stockiNail
144a6c0c27 Enable borderDash option in the grid as scriptable (#10519) 2022-07-26 08:28:15 -04:00
Evert Timberg
a39f694184 Allow time scale to offset using skipped ticks (#10278) 2022-04-03 16:05:43 -04: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
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
Jukka Kurkela
10292c6912 Linear: determine grace amount from range (#9719) 2021-10-04 17:43:04 -04:00
Jukka Kurkela
0d4880e35c Fix chart crashing when only min is defined (#9718) 2021-10-04 14:00:27 -04:00
Evert Timberg
8e68481ec4 Remove const me = this pattern (#9646) 2021-09-14 07:37:22 -04:00
Alex Van Liew
f8a9d60fd5 [feat] support crossAlign on mirrored y-axis (#9563) 2021-08-18 07:48:36 -04:00
Jacco van den Berg
259f8e8471 lower default value of grid z index so it draws behind chart elements (#9426) 2021-07-16 11:16:31 -04:00
Evert Timberg
11045a731a Fix center axis title positions (#9413)
* Fix the title positions for center positioned axes

* Handle center position for vertical axes

* Tests
2021-07-15 08:20:22 -04:00
Evert Timberg
df49447867 Limit Math.asin inputs to the range [-1, 1] (#9410) 2021-07-14 09:14:29 +03:00
Jukka Kurkela
a8d083ac24 Apply maxTicksLimit to grid when ticks are hidden (#9277) 2021-06-18 14:11:55 -04:00
Evert Timberg
9db3680440 null or undefined should skip grid lines in the time scale (#9252)
* `null` or `undefined` should skip grid lines in the time scale

* Refactor implementation per code review
2021-06-12 10:47:14 -04:00
Jukka Kurkela
a6f0b37dfe Further improve linear tick collision estimation (#9129)
* Further improve linear tick collision estimation

* More tolerance

* Re-create fixtures

* And more tolerance
2021-05-20 10:01:47 +03:00
Jukka Kurkela
44e62e77ca Improve linear tick generators collision estimation (#8983)
* Increase distance to min/max tick to 1/3 space

* Better estimation on linear tick collision

* Lint fix

* Remove unused change
2021-04-28 16:41:57 -04:00
Jukka Kurkela
3e319f79ab Scale: draw border on separate layer after grid (#8936) 2021-04-18 07:38:46 -04:00
Evert Timberg
af7965fc31 Cartesian scale tick backdrop (#8931) 2021-04-18 12:49:22 +03:00
Jukka Kurkela
853f094937 Scale: Make sure grace is applied only once (#8913)
* Scale: Make sure grace is applied only once
* Add description to fixture
2021-04-17 07:31:15 -04:00
Jukka Kurkela
8e535c574c Skip ticks by callback value as documented (#8914) 2021-04-17 07:28:33 -04:00
Jukka Kurkela
7fab66ccd1 Support mirror option on x-axis (#8867) 2021-04-10 09:01:38 -04:00
stockiNail
7ae1064ab9 Apply scale context to ticks scriptable options instead of chart context (#8839)
* Fixes #8835

* context as argument because protected

* fixes test case on formatters

* reverts previous commits and sets the scale context in the scale init

* changes documentation about linear ticks, adding scriptable Yes
2021-04-07 16:45:39 -04:00
Jukka Kurkela
e1ddaa8992 Dissociate border options from grid options (#8823)
* Dissociate border options from grid options
* Update docs
2021-04-04 14:19:07 -04:00
Jukka Kurkela
1a5a15265a Revert "Scale: draw offset grid for labels before autoSkip (#8748)" (#8752)
This reverts commit cdba66ccef.
2021-03-30 08:00:19 -04:00
Jukka Kurkela
cdba66ccef Scale: draw offset grid for labels before autoSkip (#8748)
* Scale: draw offset grid for labels before autoSkip
* fix tests
2021-03-29 16:53:47 -04:00
Jukka Kurkela
9499a1e1ef Move scale defaults to separate file (#8692) 2021-03-21 18:13:50 -04:00
Jukka Kurkela
bd9bc69c0c Move autoSkip related functions to separate file (#8691) 2021-03-21 17:07:28 -04:00
Jukka Kurkela
416062bf68 Update tick positioning (#8657)
* Update tick positioning
* Update tests
2021-03-17 18:22:21 -04:00
Jukka Kurkela
420aa027b3 Exclude base-line from bar size (#8648)
* Exclude base-line from bar size

* lint

* add to types
2021-03-16 08:49:19 -04:00
Jukka Kurkela
0a579b6813 Add alignToPixles option for scales (#8649) 2021-03-16 08:41:51 -04:00
Jukka Kurkela
99596b0434 Reduce duplication in drawGrid (#8647) 2021-03-16 08:07:17 -04:00
Jukka Kurkela
a026b60653 Change default autoSkipPadding to 3 (#8629) 2021-03-13 13:30:19 -05:00
Evert Timberg
6ac89cbb25 Rename scale gridLines options to be clearer (#8628)
* Rename `options.gridLines` to `options.grid`

* Rename `offsetGridLines` to `offset`
2021-03-13 19:49:09 +02:00
Jukka Kurkela
9799dbd5a0 Scale: autoSkip before fit (#8627)
Scale: autoSkip now occurs before fit in the update process
2021-03-13 11:36:12 -05:00
Jukka Kurkela
bedc3f1575 Fix autoSkip (#8619)
* Fix autoSkip
* Add tests
2021-03-11 16:25:16 -05:00
Jukka Kurkela
7c8ee6e77f Add rollup-plugin-size and shave couple of bytes (#8618)
* Add rollup-plugin-size

* Shave couple of bytes
2021-03-11 16:20:54 -05:00
Jukka Kurkela
d48a62a4e9 Add backgroundColor for scales (#8606)
* Add backgroundColor for scales
* Loosen the threshold
2021-03-10 08:18:10 -05:00
Jukka Kurkela
f7ebedc367 Scale: refactor drawTitle, add tests (#8598)
* Scale: refactor drawTitle, add tests
* CC, lint
* update
2021-03-09 08:35:43 -05:00
Jukka Kurkela
7ccf9e2d4d Add grace option for linear scale (#8581)
* Add `grace` option for linear scale

* cc
2021-03-06 17:18:49 -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