Skip to content

Commit 229b942

Browse files
pan-kotjperalsjsilllRaj Jaiswala-macc
authored
feat: Charts v0.1 release (#2)
* Fix retrieval of error bar points * Use test classes in tooltip details * Add coverage * Add coverage * Update tests * Refactor dev page * Override tooltip content based on page settings * Add chart with 3 lines * Remove unsupported types from dev page * Fix aria label * support large series nav * sorted group points in nav * wip: non-sticky points * wip: group highlight * scatter demos * chart-extra * scrollable tooltip * demos structure * demos structure * demos structure * fix points order in thresholds * fix destroyed points crash * custom highlighting control * target placement * scatter chart improvements * take keyboard nav from dismissed point place * highlight halo * better hovering * Customize font size of custom footer in error bars examples * Render error bar series name in tooltip by default * fix cursor placement * fix tooltip for duplicate points * Restyle default error bar tooltip * Remove spacing above key-value details in tooltip * improve tooltip behaviour * restore highlight on re-render * fix test * Accept multiple error bar series per series * Add multiple error bars to one example * Update Documenter snapshot * refactor colour counter fix * advanced navigation announcements * formatted point announcements * use aria-hidden for hr and markers * improve nav outline size * a11y fix for legend * Preserve sort order of error bar series on render * Import design-tokens from node_modules * Add coverage for ':previous' selector * Always return errorRanges array in tooltip render callback * Update example * Refactor error bar unit tests * Refactor error bar unit tests * Emit warnings for unsupported usages of errorbar series * Only validate series when they change * fix navigation direction * correct nav direction for pie * clean migration pages * Optionally add tooltip sub-items to error bars dev page * Remove leftover assertion * Re-add coverage for warning in tooltip * Fine tune styles * Disable release workflow * Only add footnote when some error bar is present in the tooltip * Remove undesired divider * wip: refactoring chart core * fix keyboard page nav * code comment fix * core-line-chart demo * moved tooltip utils to core * custom tooltip snapping * throttle * axes to core * snap 0 -> 4 * refactored tooltip definitions * default tooltip content in core * smallfix * simplify default markers * show markers for isolated points * respect showInLegend config for series * reorganize core components * move tooltip tracks to tooltip-extra * small fix in nav controller * chart extra base * refactored chart api * svg renderer pool * resolve pointer corner cases * improved renderer utils * Add innerValue and innerDescription to donut chart dev page * Revert "Disable release workflow" This reverts commit b036ef0. * Update Documented snapshot * Fix custom pie segment title rendering * Restore pie chart custom tooltip tests * Remove unreachable code * Add coverage for donut chart * Fix ARIA label in dev page * simpler api * clear highlight on tooltip dismiss * legend item highlighted state * internal legend visibility mode * refactor chart-extra * refactor chart-extra * update documenter snapshot * Add test coverage * Set whisker length to 9px * codestyle fix * updated highlighted detail indicator style * Set whisker length to 13px * update thresholds computation to exclude other thresholds * fix filter props propagation * refactor core components * refactor core filters code * refactor chart-core * refactor chart core * refactor core chart utils * lockfile v2 * Remove unnecessary options props from internal charts * Fine tune test for coverage * Split multiple error bars per series to separate example * Refactor internal pie chart to not accept Highcharts options * npm install * fix pacakge lock * fix eslint errors * Group error ranges in dev page tooltip footer * fix rects for boost cahrts * nodata responsiveness * fix group a11y description * small changes to test pages * Set whisker length to 17px * fix points accessible name * use cursor pointer * fix legend highlight for touch devices * update pie chart connectors color * De not customize whisker length * simpler internal cartesian * refactored cartesian chart * small change to core chart api * rename files * chart tooltip api series -> point * update pie segments and inner are api * pie tooltip details api * refactored pie chart * alternative visible series integration * fix pie chart halo * don't show highlight indicator for single tooltip series * update line markers and marker distance in legend item * consistent empty state * restore formatter tests * a11y improvements * restore threshold tests * restore chart options tests * restore tooltip tests * restore legend tests * unit tests refactor * remove tooltip placement unit tests * wip: navigation tests * rm unused code * refactor core interfaces * fix linting error * tooltip on group test * tests cov * remove unused code * minor fix * update test-utils api * invert legend click actions * add refererences to github issues * alternative marker highlight * markers highlight state * small vd fix * fix errorbar colors * fix series details style, same as components/pull/3577 * change markers vd * fix thresholds visibility bug * legend vd * use correct token for white bg * fix no-data vd * legend vd * fix scroll baheaviour in tooltip * remove unneeded dependency in async store dependency array * handle duplicate listeners in async store * codestyle change * fix no-data empty and no-match when not provided * alternative no-data container * rm no-data-to-display dep * fix controlled visibility for thresholds * codestyle * removed obsolete tokens sync code * remove no longer necessary pie no-data override * codestyle fix * refactor tests * removed leftover focus ref from legend * update test utils api * use custom cds hook for useId + mark react 16 as peer-dev (#30) Co-authored-by: Raj Jaiswal <[email protected]> * codestyle * disallow highlight actions when tooltip is pinned * update point highlight logic * simplify app context direction setting * feat: add support for legend side positioning (#31) * feat: add support legend side positioning * fix: remove console.log * combine core line chart and core legend pages * fix legend size and actions placement --------- Co-authored-by: Joao Silveira <[email protected]> Co-authored-by: Andrei Zhaleznichenka <[email protected]> * Rename slot 'details' to 'description' * consistent markers * fix no-match state detection * fix ts error * Rename linkedErrorbars to errorRanges * Mock warnOnce * Render default keys and values in tooltip if not defined * refactor cartesian series util * Fix type * fix types mismatch between core and cartesian * simpler chart options merginng * feat: implement optional legend popover (#29) * fix code comment * Revert "feat: implement optional legend popover (#29)" This reverts commit a2c6a8b. * feat: add navigator prop to core chart (#34) * naming change * updated api docs * fix stacking in pages * update documenter snapshot * export internal core test utils wrapper * don't call value formatter on categories * addressed ghost points in large series bug bash finding * use reversed stacks by default * ensure all accessible labels are supported via our i18n * feat: scroll into view highlighted legend item (#35) * feat: scroll into view highlighted legend item * fix: remove whole page scroll behavior * add actions to the core line chart page tooltip * codestyle * fix stale elements bug * remove duplicate code * code cleanup and refactoring * add support for pie chart segment aria label * refactor container styles * tooltip vr tests * docs changes * codestyle * updated donut inner area placement * more code comments * feat: support maxHeight for legend in core chart component (#36) * feat: support bottomMaxHeight in core chart legend * fix: address comments * fix: remove disabled behavior * fix: move max height logic to chart container * fix: address comments * fix: make isMouseContainer a reference * fix: address comments * feat: legend tooltip (#38) * feat: legend tooltip * feat: legend tooltip * legend tooltip with controller (#39) * address comments * remove setParent * remove setParent --------- Co-authored-by: Andrei Zhaleznichenka <[email protected]> * fix no data paddings to avoid content cut off * fix no-data rtl * fix legend focus in ff * minor changes to a test page * non-directional styles for no-data * removed leftoved code * simpler zoom demo * rtl visual tests * sparkline demos * fix highlight for linked errorbars * fix tooltip position for group mode --------- Co-authored-by: Joan Perals Tresserra <[email protected]> Co-authored-by: João Silveira <[email protected]> Co-authored-by: Raj Jaiswal <[email protected]> Co-authored-by: Joao Silveira <[email protected]> Co-authored-by: Anurag Makade <[email protected]> Co-authored-by: João Silveira <[email protected]>
1 parent a114fcb commit 229b942

File tree

212 files changed

+22866
-662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+22866
-662
lines changed

.eslintrc

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"plugin:react/jsx-runtime",
88
"plugin:prettier/recommended",
99
"plugin:no-unsanitized/DOM",
10-
"plugin:@vitest/legacy-recommended"
10+
"plugin:@vitest/legacy-recommended",
1111
],
1212
"parserOptions": {
1313
"ecmaVersion": "latest",
1414
"sourceType": "module",
1515
"ecmaFeatures": {
16-
"jsx": true
17-
}
16+
"jsx": true,
17+
},
1818
},
1919
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import", "simple-import-sort", "@vitest"],
2020
"rules": {
@@ -29,22 +29,22 @@
2929
"react/no-unstable-nested-components": [
3030
"error",
3131
{
32-
"allowAsProps": true
33-
}
32+
"allowAsProps": true,
33+
},
3434
],
3535
"react/forbid-component-props": [
3636
"warn",
3737
{
38-
"forbid": ["className", "id"]
39-
}
38+
"forbid": ["className", "id"],
39+
},
4040
],
4141
"react/jsx-boolean-value": ["error", "always"],
4242
"@typescript-eslint/naming-convention": [
4343
"error",
4444
{
4545
"selector": "typeLike",
46-
"format": ["PascalCase"]
47-
}
46+
"format": ["PascalCase"],
47+
},
4848
],
4949
"react-hooks/rules-of-hooks": "error",
5050
"react-hooks/exhaustive-deps": ["error"],
@@ -57,7 +57,8 @@
5757
"header/header": [
5858
"error",
5959
"line",
60-
[" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"]
60+
[" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"],
61+
2,
6162
],
6263
"no-restricted-imports": [
6364
"error",
@@ -66,44 +67,44 @@
6667
{
6768
"name": "react",
6869
"importNames": ["default"],
69-
"message": "Prefer named imports."
70+
"message": "Prefer named imports.",
7071
},
7172
{
7273
"name": "@cloudscape-design/components",
73-
"message": "Prefer subpath imports."
74-
}
75-
]
76-
}
74+
"message": "Prefer subpath imports.",
75+
},
76+
],
77+
},
7778
],
7879
"import/no-useless-path-segments": [
7980
"warn",
8081
{
81-
"noUselessIndex": true
82-
}
82+
"noUselessIndex": true,
83+
},
8384
],
8485
"simple-import-sort/imports": "warn",
85-
"@vitest/no-focused-tests": "error"
86+
"@vitest/no-focused-tests": "error",
8687
},
8788
"settings": {
8889
"react": {
89-
"version": "detect"
90-
}
90+
"version": "detect",
91+
},
9192
},
9293
"env": {
9394
"browser": true,
94-
"es6": true
95+
"es6": true,
9596
},
9697
"overrides": [
9798
{
9899
"files": ["**/__integ__/**", "./test/**"],
99100
"rules": {
100101
// useBrowser is not a React hook
101102
"react-hooks/rules-of-hooks": "off",
102-
"react-hooks/exhaustive-deps": "off"
103+
"react-hooks/exhaustive-deps": "off",
103104
},
104105
"env": {
105-
"jest": true
106-
}
106+
"jest": true,
107+
},
107108
},
108109
{
109110
"files": ["src/**", "pages/**", "test/**", "scripts/**"],
@@ -121,13 +122,11 @@
121122
// Anything not matched in another group.
122123
["^"],
123124
// Styles come last.
124-
[
125-
"^.+\\.?(css)$","^.+\\.?(css.js)$", "^.+\\.?(scss)$", "^.+\\.?(selectors.js)$"
126-
]
127-
]
128-
}
129-
]
130-
}
131-
}
132-
]
125+
["^.+\\.?(css)$", "^.+\\.?(css.js)$", "^.+\\.?(scss)$", "^.+\\.?(selectors.js)$"],
126+
],
127+
},
128+
],
129+
},
130+
},
131+
],
133132
}

.github/workflows/build-lint-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
with:
2525
artifact-path: dist
2626
artifact-name: dev-pages
27+
skip-codeql: true
2728
deploy:
2829
needs: build
2930
uses: cloudscape-design/actions/.github/workflows/deploy.yml@main

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
push:
77
branches:
88
- main
9+
- charts-0.1
910
- "dev-v3-*"
1011

1112
permissions:
@@ -57,4 +58,4 @@ jobs:
5758
AWSUI_GITHUB_COMMIT_SHA: ${{ github.sha }}
5859
AWSUI_GITHUB_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
5960
AWSUI_GITHUB_REPOSITORY_NAME: ${{ github.event.repository.full_name }}
60-
AWSUI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
AWSUI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/visual-regression.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@ jobs:
1919
if: github.event.ref != 'refs/heads/main'
2020
steps:
2121
- uses: actions/checkout@v4
22-
# - uses: actions/setup-node@v4
23-
# with:
24-
# node-version: 20
25-
# cache: "npm"
26-
# - name: "Get reference run id"
27-
# run: |
28-
# echo "RUN_ID=`gh run --repo $GITHUB_REPOSITORY --branch main list --workflow "Visual Regressions" --json databaseId --jq .[0].databaseId`" >> $GITHUB_ENV
29-
# echo "Reference snapshots created in run ${RUN_ID}"
30-
# env:
31-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
# - uses: actions/download-artifact@v4
33-
# with:
34-
# name: visual-regression-snapshots
35-
# github-token: ${{ secrets.GITHUB_TOKEN }}
36-
# run-id: ${{ env.RUN_ID }}
37-
# path: ${{ env.VISUAL_REGRESSION_SNAPSHOT_DIRECTORY }}
38-
# - run: npm install
39-
# - run: npm run build
40-
# - run: npm run test:visual
41-
# - uses: actions/upload-artifact@v4
42-
# if: always()
43-
# with:
44-
# name: visual-regression-snapshots-results
45-
# path: ${{ env.VISUAL_REGRESSION_SNAPSHOT_DIRECTORY }}
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: "npm"
26+
- name: "Get reference run id"
27+
run: |
28+
echo "RUN_ID=`gh run --repo $GITHUB_REPOSITORY --branch main list --workflow "Visual Regressions" --json databaseId --jq .[0].databaseId`" >> $GITHUB_ENV
29+
echo "Reference snapshots created in run ${RUN_ID}"
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
- uses: actions/download-artifact@v4
33+
with:
34+
name: visual-regression-snapshots
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
run-id: ${{ env.RUN_ID }}
37+
path: ${{ env.VISUAL_REGRESSION_SNAPSHOT_DIRECTORY }}
38+
- run: npm install
39+
- run: npm run build
40+
- run: npm run test:visual
41+
- uses: actions/upload-artifact@v4
42+
if: always()
43+
with:
44+
name: visual-regression-snapshots-results
45+
path: ${{ env.VISUAL_REGRESSION_SNAPSHOT_DIRECTORY }}
4646
update:
4747
name: Update Snapshots
4848
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ coverage
44
lib
55
/__image_snapshots__
66
dist
7-
/src/test-utils/selectors
8-
/src/test-utils/dom/index.ts
7+
/src/test-utils/selectors/**/*.ts
8+
!/src/test-utils/selectors/index.ts
99
.DS_STORE

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
"exports": {
4141
".": "./index.js",
4242
"./test-utils/dom": "./test-utils/dom/index.js",
43+
"./test-utils/dom/internal/core": "./test-utils/dom/internal/core.js",
4344
"./test-utils/selectors": "./test-utils/selectors/index.js",
45+
"./test-utils/selectors/internal/core": "./test-utils/selectors/internal/core.js",
4446
"./internal/api-docs/*.js": "./internal/api-docs/*.js",
4547
"./internal-do-not-use/core-chart": "./internal-do-not-use/core-chart.js"
4648
},
@@ -53,7 +55,7 @@
5355
"@cloudscape-design/components": "^3",
5456
"@cloudscape-design/design-tokens": "^3",
5557
"highcharts": "^12.2.0",
56-
"react": ">=18.2.0"
58+
"react": ">=16.0.0"
5759
},
5860
"devDependencies": {
5961
"@cloudscape-design/browser-test-tools": "^3.0.4",

0 commit comments

Comments
 (0)