Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving mouse hover behavior in Line Chart #33261

Open
wants to merge 122 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
010b227
Draft implementation of charts in v9
AtishayMsft May 6, 2024
bd8c925
Update tsconfig
AtishayMsft May 7, 2024
bd13f03
Resolve errors
AtishayMsft Jun 3, 2024
eada51d
Update react popover package version
AtishayMsft Jun 4, 2024
6568f1b
Enable horizontal bar chart. Without focus zone and callout.
AtishayMsft Jun 10, 2024
62199f2
Enable tabster based focus behavior for Horizontal Bar Chart
AtishayMsft Jun 12, 2024
2382caf
Popover for HorizontalBarChart (#31774)
srmukher Jun 20, 2024
8583df3
sparkline V9 (#31785)
Anush2303 Jun 28, 2024
b247ff3
Testing of Sparkline and HBC (#31952)
Anush2303 Jul 10, 2024
3c51973
Migrating Donut chart to v9 (#31948)
srmukher Jul 10, 2024
e6ec5ce
cartesian chart in V9 (#31983)
Anush2303 Jul 13, 2024
6c47984
vertical bar chart in V9 (#31924)
Anush2303 Jul 18, 2024
91555d0
line chartV9 (#31884)
Anush2303 Jul 18, 2024
e26e0d5
Merge master
AtishayMsft Jul 23, 2024
09c0144
Update package dependencies to latest as per master
AtishayMsft Jul 24, 2024
c99c081
Fix dependency versions as per other components
AtishayMsft Jul 24, 2024
f115763
Disable package version mismatch by overriding syncpack config
AtishayMsft Jul 24, 2024
d585efb
Override d3 version dependency mismatch while standing up v9
AtishayMsft Jul 29, 2024
29c9b35
Adding the Sparkline chart unit testcase into the chartsV9. (#32090)
v-asurse Jul 29, 2024
ecfd51c
Cartesian V9 Migration (#32178)
Anush2303 Aug 2, 2024
6baf6d7
Legend component V9 (#32134)
srmukher Aug 2, 2024
dbb7835
line chart Overflow fix (#32225)
Anush2303 Aug 5, 2024
4b816bf
Style fixes for VBC (#32245)
Anush2303 Aug 8, 2024
11c401b
Line issue and Rotated labels fix (#32259)
Anush2303 Aug 8, 2024
28f1d11
Popover for Cartesian charts v9 (#32249)
srmukher Aug 8, 2024
ff42a4f
Remove charts not planned in this releae
AtishayMsft Aug 9, 2024
933a603
Enabling popover for Vertical bar chart (#32266)
srmukher Aug 9, 2024
70f8959
Resolve build errors in chart controls
AtishayMsft Aug 9, 2024
c943067
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
AtishayMsft Aug 9, 2024
f5d5c59
Fix build errors
AtishayMsft Aug 12, 2024
d53a2c1
Fixing build errors related to popover and legends (#32288)
srmukher Aug 14, 2024
c3d0576
Donut chart test case modified. (#32064)
v-asurse Aug 20, 2024
080046c
Fix build errors
AtishayMsft Aug 20, 2024
a8f6061
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
AtishayMsft Aug 20, 2024
5968c52
Fix more build errros
AtishayMsft Aug 20, 2024
a49cc8c
Migrating SVGTooltipText component in V9 (#32345)
srmukher Aug 21, 2024
ac59bdd
dark mode fixes (#32335)
Anush2303 Aug 21, 2024
70eda54
bug fixes for lineChart and VBC (#32322)
Anush2303 Aug 23, 2024
5add7fe
Fix build errors
AtishayMsft Aug 23, 2024
32b8f03
Fix dependency version mismatch
AtishayMsft Aug 23, 2024
3e719c9
Migrating focusable tooltip component in V9 (#32364)
srmukher Aug 23, 2024
d020884
Fix build errrors
AtishayMsft Aug 23, 2024
dbcdc98
Modified some changes in the vertical bar chart files. (#32261)
v-asurse Aug 26, 2024
1aaffcb
Merging chart hover card with popover component in V9 (#32400)
srmukher Aug 28, 2024
6678cd4
Migration of Theme in V9 charts (#32372)
Anush2303 Aug 28, 2024
0dfd2c9
Comment out code to resolve build issues
AtishayMsft Aug 28, 2024
15f845b
Fixed legend opacity and shape (#32413)
srmukher Aug 29, 2024
5e3a01a
Fix build break
AtishayMsft Sep 3, 2024
ca9ecdd
Merge remote-tracking branch 'origin/master' into usr/atisjai/chartsV9
AtishayMsft Sep 3, 2024
78c741f
Update yarn lock
AtishayMsft Sep 3, 2024
c16b2d5
Split react charts into 2 folders library and stories
AtishayMsft Sep 3, 2024
7bd8ff3
Normalize package name as per fluent updates #31893
AtishayMsft Sep 3, 2024
8aa2c18
Adopt storybook 7 #32018
AtishayMsft Sep 3, 2024
82e2cd3
Fix build errors
AtishayMsft Sep 4, 2024
7cdf166
Fix storybook and enable charts in v9 docsite
AtishayMsft Sep 4, 2024
174fb35
Fixing background for legends (#32466)
srmukher Sep 5, 2024
925d2cf
Fixing popover content for cartesian and Vertical bar chart (#32464)
srmukher Sep 5, 2024
6fff53b
Fixed popover size and cover target issue (#32470)
srmukher Sep 5, 2024
270c7da
Fixed legend related bugs (#32487)
srmukher Sep 9, 2024
84fb5c5
enabled Tabster in charts (#32486)
Anush2303 Sep 10, 2024
c373dbb
Update chart description and best practices
AtishayMsft Sep 10, 2024
6d8f95a
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
AtishayMsft Sep 10, 2024
43641a0
chartsV9 tasks and bug fixes (#32483)
Anush2303 Sep 11, 2024
713fcb9
Modified horizontal bar chart, line chart and legends testcases file.…
v-asurse Sep 16, 2024
bafba6f
Added the Visual Regression testcases for ChartsV9. (#32868)
v-asurse Sep 19, 2024
e389a7c
RTL FIXES (#32828)
Anush2303 Sep 22, 2024
aa4861f
Removed chartsV8 dependency from chartsV9 testcase files. (#32869)
v-asurse Sep 27, 2024
4b10ecc
Added a test case for dynamic x Axis in vertical bar chart. (#32934)
v-asurse Sep 30, 2024
4c37458
Adding support for custom Popover (#32922)
srmukher Oct 2, 2024
3f0d5ce
Make charts responsive (#32824)
krkshitij Oct 2, 2024
6ff782f
Charts V9 P2 bugs (#32950)
Anush2303 Oct 2, 2024
f9f6588
Fix build errors
AtishayMsft Oct 2, 2024
0d31e91
Merge remote-tracking branch 'origin/master' into usr/atisjai/chartsV9
AtishayMsft Oct 2, 2024
cd1aea9
Resolve build errors
AtishayMsft Oct 2, 2024
a2fa645
Update d3 dependency versions
AtishayMsft Oct 2, 2024
e2dc00c
Revert yarn lock changes
AtishayMsft Oct 2, 2024
9a9d5e3
Comment out failing tests and update snapshots
AtishayMsft Oct 2, 2024
e4972c5
Run prettier on VR tests
AtishayMsft Oct 3, 2024
6d614df
Rotate label fix (#32974)
Anush2303 Oct 4, 2024
01495b7
Fixed popover related bugs for Donut, HBC and VBC (#32973)
srmukher Oct 4, 2024
8c0a4ac
Hide overlapping x-axis tick labels (#32829)
krkshitij Oct 7, 2024
97b4725
Fixing Legend related bugs (#32988)
srmukher Oct 7, 2024
1abf7f7
Fixed SVG shape related bug for line chart (#33003)
srmukher Oct 8, 2024
9ebd3fd
Fixing custom popover not visible bug (#33008)
srmukher Oct 8, 2024
0b9d708
Update content of stories
AtishayMsft Oct 9, 2024
e60fd75
Update tokens to match v9 typography
AtishayMsft Oct 10, 2024
ff2e9f0
Fix names of style files
AtishayMsft Oct 10, 2024
994d1a1
Fix crash in custom popover
AtishayMsft Oct 10, 2024
7d4e39d
Merge branch 'master' into usr/atisjai/chartsV9
AtishayMsft Oct 10, 2024
361b8e8
Update change file
AtishayMsft Oct 10, 2024
8823c87
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
AtishayMsft Oct 10, 2024
ae92db2
Update snapshots
AtishayMsft Oct 10, 2024
811ee9b
Enable no unused locals rule
AtishayMsft Oct 10, 2024
e64eedc
Update snapshots
AtishayMsft Oct 10, 2024
ee60b36
Remove window from locale utils
AtishayMsft Oct 10, 2024
68447bc
Fix window undefined issue
AtishayMsft Oct 10, 2024
7504eca
Remove all stories from ssr tests
AtishayMsft Oct 10, 2024
cf35ede
Fix lint errors
AtishayMsft Oct 11, 2024
0c291ec
Fix lint errors
AtishayMsft Oct 11, 2024
d571be0
Fix lint errors
AtishayMsft Oct 11, 2024
b3451a0
Update doc comment
AtishayMsft Oct 11, 2024
a560d8e
Fix type check errors
AtishayMsft Oct 11, 2024
2de2a1e
Update test snapshots
AtishayMsft Oct 11, 2024
643ed88
Update API file
AtishayMsft Oct 12, 2024
2e58bf7
Fix type check in stories
AtishayMsft Oct 14, 2024
37ebb82
Make charts ESM based
AtishayMsft Oct 14, 2024
fc3e74a
Fix test
AtishayMsft Oct 14, 2024
96d4457
Merge branch 'master' into usr/atisjai/chartsV9
AtishayMsft Oct 14, 2024
1071e3d
Update VR stories
AtishayMsft Oct 14, 2024
ed80ac6
Fixing styles for custom callout stories (#33054)
srmukher Oct 16, 2024
74dbfba
Fixing alignment issue of legends (#33072)
srmukher Oct 17, 2024
1066091
Remove I prefix from interfaces
AtishayMsft Oct 17, 2024
11d2637
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
AtishayMsft Oct 17, 2024
000d854
Fix vr test interfaces
AtishayMsft Oct 17, 2024
8fa237e
Address review comments
AtishayMsft Oct 18, 2024
1c9257c
Making changes for Popover component (#33089)
srmukher Oct 22, 2024
fed36fc
Fixing build errors in V9 (#33099)
srmukher Oct 22, 2024
9ccfbe5
Usr/atisjai/charts v9move (#33107)
AtishayMsft Oct 28, 2024
c00134c
Resolve review comments
AtishayMsft Oct 28, 2024
3584d01
Styled example for Donut chart (#33159)
srmukher Oct 30, 2024
b07a010
Fixing High Contrast Bugs - Part 1 (#33170)
srmukher Oct 30, 2024
b1527a7
Improving mouse hover behaviour in Line Chart
srmukher Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/public-docsite-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"@fluentui/react-calendar-compat": "*",
"@fluentui/react-charts-preview": "*",
"@fluentui/react-datepicker-compat": "*",
"@fluentui/react-migration-v8-v9": "*",
"@fluentui/react-migration-v0-v9": "*",
Expand Down
1 change: 1 addition & 0 deletions apps/vr-tests-react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@fluentui/react-button": "*",
"@fluentui/react-calendar-compat": "*",
"@fluentui/react-card": "*",
"@fluentui/react-charts-preview": "*",
"@fluentui/react-checkbox": "*",
"@fluentui/react-combobox": "*",
"@fluentui/react-context-selector": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import * as React from 'react';
import type { Meta } from '@storybook/react';
import { DARK_MODE, getStoryVariant, RTL, TestWrapperDecorator } from '../../utilities';
import { Steps, StoryWright } from 'storywright';
import { ChartProps, ChartDataPoint, DonutChart } from '@fluentui/react-charts-preview';

export default {
title: 'Charts/DonutChart',

decorators: [
(story, context) => TestWrapperDecorator(story, context),
(story, context) => {
const steps = new Steps().snapshot('default', { cropTo: '.testWrapper' }).end();
return <StoryWright steps={steps}>{story(context)}</StoryWright>;
},
],
} satisfies Meta<typeof DonutChart>;

export const Basic = () => {
const points: ChartDataPoint[] = [
{ legend: 'first', data: 20000, color: '#DADADA', xAxisCalloutData: '2020/04/30' },
{ legend: 'second', data: 39000, color: '#0078D4', xAxisCalloutData: '2020/04/20' },
];

const data: ChartProps = {
chartTitle: 'Donut chart basic example',
chartData: points,
};
return (
<div style={{ padding: 10 }}>
<DonutChart
culture={window.navigator.language}
data={data}
innerRadius={55}
href="https://developer.microsoft.com/en-us/"
legendsOverflowText={'overflow Items'}
hideLegend={false}
height={220}
width={176}
valueInsideDonut={39000}
/>
</div>
);
};

export const BasicDarkMode = getStoryVariant(Basic, DARK_MODE);

export const BasicRTL = getStoryVariant(Basic, RTL);

export const Dynamic = () => {
const data: ChartProps = {
chartTitle: 'Donut chart dynamic example',
chartData: [
{
legend: 'first',
data: Math.floor(120),
color: '#00bcf2',
},
{
legend: 'second',
data: Math.floor(130),
color: '#b4a0ff',
},
{
legend: 'third',
data: Math.floor(10),
color: '#fff100',
},
{
legend: 'fourth',
data: Math.floor(270),
color: '#605e5c',
},
],
};

return (
<div style={{ padding: 10 }}>
<DonutChart
data={data}
innerRadius={35}
legendProps={{
allowFocusOnLegends: true,
}}
hideLabels={false}
showLabelsInPercent={false}
/>
</div>
);
};

export const DynamicDarkMode = getStoryVariant(Dynamic, DARK_MODE);

export const DynamicRTL = getStoryVariant(Dynamic, RTL);
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
import * as React from 'react';
import type { Meta } from '@storybook/react';
import { DARK_MODE, getStoryVariant, RTL, TestWrapperDecorator } from '../../utilities';
import { Steps, StoryWright } from 'storywright';
import { ChartProps, HorizontalBarChart, HorizontalBarChartVariant } from '@fluentui/react-charts-preview';

export default {
title: 'Charts/HorizontalBarChart',

decorators: [
(story, context) => TestWrapperDecorator(story, context),
(story, context) => {
const steps =
context.name.includes('Basic') && !context.name.includes('RTL')
? new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.executeScript(
// eslint-disable-next-line @fluentui/max-len
`document.querySelectorAll('g[id^="_HorizontalLine"]')[2].children[0].dispatchEvent(new MouseEvent('mouseover', { bubbles: true, cancelable: true }));`,
)
.snapshot('hover', { cropTo: '.testWrapper' })
.end()
: new Steps().snapshot('default', { cropTo: '.testWrapper' }).end();
return <StoryWright steps={steps}>{story(context)}</StoryWright>;
},
],
} satisfies Meta<typeof HorizontalBarChart>;

export const Basic = () => {
const hideRatio: boolean[] = [true, false];
const data: ChartProps[] = [
{
chartTitle: 'one',
chartData: [
{
legend: 'one',
horizontalBarChartdata: { x: 1543, y: 15000 },
color: '#4cb4b7',
xAxisCalloutData: '2020/04/30',
yAxisCalloutData: '10%',
},
],
},
{
chartTitle: 'two',
chartData: [
{
legend: 'two',
horizontalBarChartdata: { x: 800, y: 15000 },
color: '#800080',
xAxisCalloutData: '2020/04/30',
yAxisCalloutData: '5%',
},
],
},
{
chartTitle: 'three',
chartData: [
{
legend: 'three',
horizontalBarChartdata: { x: 8888, y: 15000 },
color: '#ff0000',
xAxisCalloutData: '2020/04/30',
yAxisCalloutData: '59%',
},
],
},
{
chartTitle: 'four',
chartData: [
{
legend: 'four',
horizontalBarChartdata: { x: 15888, y: 15000 },
color: '#fbc0c3',
xAxisCalloutData: '2020/04/30',
yAxisCalloutData: '105%',
},
],
},
{
chartTitle: 'five',
chartData: [
{
legend: 'five',
horizontalBarChartdata: { x: 11444, y: 15000 },
color: '#f7630c',
xAxisCalloutData: '2020/04/30',
yAxisCalloutData: '76%',
},
],
},
{
chartTitle: 'six',
chartData: [
{
legend: 'six',
horizontalBarChartdata: { x: 14000, y: 15000 },
color: '#107c10',
xAxisCalloutData: '2020/04/30',
yAxisCalloutData: '93%',
},
],
},
{
chartTitle: 'seven',
chartData: [
{
legend: 'seven',
horizontalBarChartdata: { x: 9855, y: 15000 },
color: '#6e0811',
xAxisCalloutData: '2020/04/30',
yAxisCalloutData: '65%',
},
],
},
{
chartTitle: 'eight',
chartData: [
{
legend: 'eight',
horizontalBarChartdata: { x: 4250, y: 15000 },
color: '#3a96dd',
xAxisCalloutData: '2020/04/30',
yAxisCalloutData: '28%',
},
],
},
];

return (
<div style={{ padding: '10px' }}>
<HorizontalBarChart culture={window.navigator.language} data={data} hideRatio={hideRatio} width={600} />
</div>
);
};

export const BasicDarkMode = getStoryVariant(Basic, DARK_MODE);

export const BasicRTL = getStoryVariant(Basic, RTL);

export const WithBenchmark = () => {
const hideRatio: boolean[] = [true, false];

const data: ChartProps[] = [
{
chartTitle: 'one',
chartData: [
{
legend: 'one',
data: 50,
horizontalBarChartdata: { x: 10, y: 100 },
color: '#4cb4b7',
},
],
},
{
chartTitle: 'two',
chartData: [
{
legend: 'two',
data: 30,
horizontalBarChartdata: { x: 30, y: 200 },
color: '#800080',
},
],
},
{
chartTitle: 'three',
chartData: [
{
legend: 'three',
data: 5,
horizontalBarChartdata: { x: 15, y: 50 },
color: '#ff0000',
},
],
},
];

return (
<div style={{ padding: '10px' }}>
<HorizontalBarChart data={data} hideRatio={hideRatio} width={600} chartDataMode="fraction" />
</div>
);
};

WithBenchmark.storyName = 'With_Benchmark';

export const WithBenchmarkDarkMode = getStoryVariant(WithBenchmark, DARK_MODE);

export const WithBenchmarkRTL = getStoryVariant(WithBenchmark, RTL);

export const Variant = () => {
const data: ChartProps[] = [
{
chartTitle: 'one',
chartData: [
{
legend: 'one',
horizontalBarChartdata: { x: 1543, y: 15000 },
color: '#4cb4b7',
},
],
},
{
chartTitle: 'two',
chartData: [
{
legend: 'two',
horizontalBarChartdata: { x: 800, y: 15000 },
color: '#800080',
},
],
},
{
chartTitle: 'three',
chartData: [
{
legend: 'three',
horizontalBarChartdata: { x: 8888, y: 15000 },
color: '#ff0000',
},
],
},
{
chartTitle: 'four',
chartData: [
{
legend: 'four',
horizontalBarChartdata: { x: 15888, y: 15000 },
color: '#fbc0c3',
},
],
},
{
chartTitle: 'five',
chartData: [
{
legend: 'five',
horizontalBarChartdata: { x: 11444, y: 15000 },
color: '#f7630c',
},
],
},
{
chartTitle: 'six',
chartData: [
{
legend: 'six',
horizontalBarChartdata: { x: 14000, y: 15000 },
color: '#107c10',
},
],
},
{
chartTitle: 'seven',
chartData: [
{
legend: 'seven',
horizontalBarChartdata: { x: 9855, y: 15000 },
color: '#6e0811',
},
],
},
{
chartTitle: 'eight',
chartData: [
{
legend: 'eight',
horizontalBarChartdata: { x: 4250, y: 15000 },
color: '#3a96dd',
},
],
},
];

return (
<div style={{ padding: '10px' }}>
<HorizontalBarChart data={data} variant={HorizontalBarChartVariant.AbsoluteScale} hideLabels={false} />
</div>
);
};

export const VariantDarkMode = getStoryVariant(Variant, DARK_MODE);

export const VariantRTL = getStoryVariant(Variant, RTL);
Loading
Loading