File tree 2 files changed +14
-1
lines changed
packages/frontend/src/components
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ const Base = {
76
76
args : {
77
77
src : 'federation' ,
78
78
span : 'hour' ,
79
+ nowForChromatic : 1716263640000 ,
79
80
} ,
80
81
parameters : {
81
82
layout : 'centered' ,
@@ -100,18 +101,21 @@ const Base = {
100
101
export const FederationChart = {
101
102
...Base ,
102
103
args : {
104
+ ...Base . args ,
103
105
src : 'federation' ,
104
106
} ,
105
107
} satisfies StoryObj < typeof MkChart > ;
106
108
export const NotesTotalChart = {
107
109
...Base ,
108
110
args : {
111
+ ...Base . args ,
109
112
src : 'notes-total' ,
110
113
} ,
111
114
} satisfies StoryObj < typeof MkChart > ;
112
115
export const DriveChart = {
113
116
...Base ,
114
117
args : {
118
+ ...Base . args ,
115
119
src : 'drive' ,
116
120
} ,
117
121
} satisfies StoryObj < typeof MkChart > ;
Original file line number Diff line number Diff line change @@ -77,13 +77,21 @@ const props = withDefaults(defineProps<{
77
77
stacked?: boolean;
78
78
bar?: boolean;
79
79
aspectRatio?: number | null;
80
+ nowForChromatic?: number;
80
81
}>(), {
81
82
args: undefined,
82
83
limit: 90,
83
84
detailed: false,
84
85
stacked: false,
85
86
bar: false,
86
87
aspectRatio: null,
88
+
89
+ /**
90
+ * @desc Overwrites current date to fix background lines of chart.
91
+ * @ignore Only used for Chromatic. Don't use this for production.
92
+ * @see https://github.com/misskey-dev/misskey/pull/13830#issuecomment-2155886151
93
+ */
94
+ nowForChromatic: undefined,
87
95
});
88
96
89
97
const legendEl = shallowRef<InstanceType<typeof MkChartLegend>>();
@@ -106,7 +114,8 @@ const getColor = (i) => {
106
114
return colorSets[i % colorSets.length];
107
115
};
108
116
109
- const now = new Date();
117
+ // eslint-disable-next-line vue/no-setup-props-destructure
118
+ const now = props.nowForChromatic != null ? new Date(props.nowForChromatic) : new Date();
110
119
let chartInstance: Chart | null = null;
111
120
let chartData: {
112
121
series: {
You can’t perform that action at this time.
0 commit comments