import { createHistogramFromBins as e, createHistogramLinear as t, createHistogramLog as n } from "./histogram.js";
import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, normalizeClass as c, onMounted as l, openBlock as u, ref as d, toDisplayString as f, watch as p } from "vue";
var m = /* @__PURE__ */ s({
	__name: "PlChartHistogram",
	props: { settings: {} },
	setup(s) {
		let m = s, h = d(), g = r(() => {
			let { xAxisLabel: e, yAxisLabel: t, threshold: n, compact: r, totalWidth: i = 674, totalHeight: a = 252 } = m.settings, o = r ? {
				top: 0,
				right: 0,
				bottom: 0,
				left: 0
			} : {
				top: 0,
				right: 30,
				bottom: 40,
				left: 85
			};
			return {
				width: i - o.left - o.right,
				height: a - o.top - o.bottom,
				margin: o,
				compact: r,
				nBins: "nBins" in m.settings ? m.settings.nBins : 10,
				xAxisLabel: e,
				yAxisLabel: t,
				threshold: n
			};
		}), _ = () => {
			let r = m.settings;
			if (r.type === "log-bins") {
				e(h.value, g.value, r.bins);
				return;
			}
			r.log ? n(h.value, g.value, r.numbers) : t(h.value, g.value, r.numbers);
		};
		return p(m, _), l(_), (e, t) => (u(), a("div", { class: c(e.$style.component) }, [s.settings.title && !s.settings.compact ? (u(), a("div", {
			key: 0,
			class: c(e.$style.title)
		}, f(s.settings.title), 3)) : i("", !0), o("div", {
			ref_key: "chart",
			ref: h
		}, null, 512)], 2));
	}
});
export { m as default };

//# sourceMappingURL=PlChartHistogram.vue2.js.map