Skip to content

Commit

Permalink
Add a highchart heatmap helper class (#1307)
Browse files Browse the repository at this point in the history
* add highchart heatmap helper class

* add erroneously deleted line back
  • Loading branch information
romanlutz authored and gaugup committed Apr 21, 2022
1 parent 29298f4 commit b20e5e3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions libs/core-ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ export * from "./lib/Interfaces/IErrorAnalysisData";
export * from "./lib/Highchart/BasicHighChart";
export * from "./lib/Highchart/FeatureImportanceDependence";
export * from "./lib/Highchart/FeatureImportanceBar";
export * from "./lib/Highchart/HeatmapHighChart";
export * from "./lib/Highchart/IHighchartsConfig";
29 changes: 29 additions & 0 deletions libs/core-ui/src/lib/Highchart/HeatmapHighChart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import _ from "lodash";
import { getTheme } from "office-ui-fabric-react";
import React from "react";

import { getDefaultHighchartOptions } from "./getDefaultHighchartOptions";
import { HighchartWrapper } from "./HighchartWrapper";
import { ICommonChartProps } from "./ICommonChartProps";

export class HeatmapHighChart extends React.Component<ICommonChartProps> {
public render(): React.ReactNode {
const defaultOptions = getDefaultHighchartOptions(getTheme());
const { className, id, fallback, configOverride = {}, theme } = this.props;
const chartOptions = _.merge({}, configOverride, defaultOptions);

return (
<HighchartWrapper
className={className}
id={id}
chartOptions={chartOptions}
fallback={fallback}
theme={theme}
modules={["heatmap"]}
/>
);
}
}

0 comments on commit b20e5e3

Please sign in to comment.