Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { format, Duration } from '../format';
import { PureStreamlitElement } from './util/StreamlitElement';
import * as recharts from 'recharts';
import './Chart.css';
const COMPONENTS = {
////////////
// Charts //
////////////
AreaChart : recharts.AreaChart,
BarChart : recharts.BarChart,
LineChart : recharts.LineChart,
ComposedChart : recharts.ComposedChart,
// PieChart <- not implemented
RadarChart : recharts.RadarChart,
// RadialBarChart <- not implemented
// ScatterChart <- not implemented
Treemap : recharts.Treemap,
////////////////////////
// General Components //
////////////////////////
// ResponsiveContainer, <- not implemented
Area : recharts.Area,
Legend : recharts.Legend,
Tooltip : recharts.Tooltip,
// Cell <- not implemented
// Text <- not implemented
import { format, Duration } from "lib/format"
import { Map as ImmutableMap } from "immutable"
import withFullScreenWrapper from "hocs/withFullScreenWrapper"
import * as recharts from "recharts"
import "./Chart.scss"
const COMPONENTS: any = {
////////////
// Charts //
////////////
AreaChart: recharts.AreaChart,
BarChart: recharts.BarChart,
LineChart: recharts.LineChart,
ComposedChart: recharts.ComposedChart,
// PieChart <- not implemented
RadarChart: recharts.RadarChart,
// RadialBarChart <- not implemented
// ScatterChart <- not implemented
Treemap: recharts.Treemap,
////////////////////////
// General Components //
////////////////////////
// ResponsiveContainer, <- not implemented
Area: recharts.Area,
Legend: recharts.Legend,
Tooltip: recharts.Tooltip,
// Cell <- not implemented
// Text <- not implemented
render () {
let colours = mergeColours(this.props.colours)
return (
h(R.ResponsiveContainer, {height: 200, width: '100%'}, [
h(R.ComposedChart, {data: this.props.site.days}, [
h(R.Bar, {
dataKey: 's',
fill: color(colours.bar1).lighten(0.2).string(),
isAnimationActive: false
}),
h(R.Line, {
dataKey: 'v',
stroke: color(colours.line1).lighten(0.2).string(),
type: 'monotone',
strokeWidth: 3,
dot: false,
isAnimationActive: false
})
])
])
)