Skip to content

Commit 3044f4d

Browse files
committed
resolve review comments
1 parent a77ee2c commit 3044f4d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/charts/chart-utilities/src/PlotlySchemaConverter.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Datum, TypedArray, PlotData, PlotlySchema } from './PlotlySchema';
2+
import { decodeBase64Fields } from './DecodeBase64Data';
23

34
// eslint-disable-next-line @typescript-eslint/naming-convention
45
export interface OutputChartType {
@@ -155,7 +156,14 @@ export const mapFluentChart = (input: any): OutputChartType => {
155156
}
156157

157158
try {
158-
const validSchema: PlotlySchema = getValidSchema(input);
159+
let validSchema: PlotlySchema = getValidSchema(input);
160+
161+
try {
162+
validSchema = decodeBase64Fields(validSchema);
163+
} catch (error) {
164+
return { isValid: false, errorMessage: `Failed to decode plotly schema: ${error}` };
165+
}
166+
159167
switch (validSchema.data[0].type) {
160168
case 'pie':
161169
return { isValid: true, type: 'donut' };

packages/charts/chart-utilities/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ export {
110110
isArrayOrTypedArray,
111111
} from './PlotlySchemaConverter';
112112

113-
export { decodeBase64Fields } from './decode-binary-data';
113+
export { decodeBase64Fields } from './DecodeBase64Data';

0 commit comments

Comments
 (0)