UNPKG

@macrostrat/column-components

Version:

React rendering primitives for stratigraphic columns

53 lines (52 loc) 1.2 kB
import { Component } from "react"; import { Slider } from "@blueprintjs/core"; import { PickerControl } from "./picker-base.js"; import h from "@macrostrat/hyper"; function SurfaceOrderSlider(props) { const { interval, onChange } = props; let val = interval.surface_order; if (val == null) { val = 5; } return h(Slider, { min: 0, max: 5, disabled: interval.surface_type == null, stepSize: 1, showTrackFill: false, value: val, onChange: (surface_order) => { if (interval.surface_type == null) { return; } return onChange({ surface_order }); } }); } function HorizontalPicker(props) { return h(PickerControl, { vertical: false, isNullable: true, ...props }); } class BoundaryStyleControl extends Component { render() { const { interval, onUpdate } = this.props; const states = [ { label: "Abrupt", value: true }, { label: "Diffuse", value: false } ]; return h(HorizontalPicker, { states, activeState: interval.definite_boundary, onUpdate }); } } export { BoundaryStyleControl, HorizontalPicker, SurfaceOrderSlider }; //# sourceMappingURL=controls.js.map