1import { Controller } from "@hotwired/stimulus" 2import { initD3 } from "helpers/graphs" 3 4export default class extends Controller { 5 static values = { 6 data: Array, 7 options: Object 8 } 9 10 connect() { 11 this.render() 12 } 13 14 async render() { 15 await initD3() 16 17 const yAxisData = this.optionsValue.yAxisData 18 const opts = Object.assign({ 19 decimalPlaces: 3, 20 grid: { 21 horizontal: true 22 }, 23 svgClass: 'kpi_graph', 24 lineColour: 'var(--grey_tint_5)' 25 }, this.optionsValue.options) 26 opts.tooltipHtmlGenerator = (point, series) => `<p class="caps_s">${_.escape(series.label)}</p><p class="caps_l">${GraphHelper.formatValue(point.y, opts)}</p>` 27 yAxisData.ticks = GraphHelper.generateTicks(yAxisData.min, yAxisData.max, yAxisData.tick_count, opts) 28 29 GraphHelper.setGraph(this.element.id.replace("_container", ""), 30 pam.graphing.line_chart_complex($(this.element), { 31 id: this.element.id.replace("_container", ""), 32 data: this.dataValue, 33 xAxisData: Object.assign({ tickSizeOuter: 0 }, this.optionsValue.xAxisData), 34 yAxisData: yAxisData 35 }, opts) 36 ) 37 } 38} 39
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.