@@ -53,6 +53,7 @@ import {
5353 createSmoothAreaSegments ,
5454 createIndividualArea ,
5555 treeShake ,
56+ buildInterLineAreas ,
5657} from ' ../lib' ;
5758import { throttle } from ' ../canvas-lib.js' ;
5859import { useConfig } from ' ../useConfig' ;
@@ -336,6 +337,8 @@ const isDataset = computed({
336337
337338const FINAL_CONFIG = ref (prepareConfig ());
338339
340+ const debug = computed (() => !! FINAL_CONFIG .value .debug );
341+
339342// v3 - Skeleton loader management
340343const { loading , FINAL_DATASET , manualLoading } = useLoading ({
341344 ... toRefs (props),
@@ -820,8 +823,8 @@ const displayedTimeLabels = computed(() => {
820823 const mod = Math .max (1 , (modulo .value || 1 ));
821824 if (maxSeries .value <= mod) return vis;
822825
823- const base = mod;
824- const all = allTimeLabels .value || [];
826+ const base = mod;
827+ const all = allTimeLabels .value || [];
825828 const start = slicer .value .start ?? 0 ;
826829
827830 const candidates = [];
@@ -878,8 +881,8 @@ function selectTimeLabel(label, relativeIndex) {
878881}
879882
880883const maxSeries = computed (() => {
881- const len = safeInt ((slicer .value .end ?? 0 ) - (slicer .value .start ?? 0 ))
882- return Math .max (1 , len)
884+ const len = safeInt ((slicer .value .end ?? 0 ) - (slicer .value .start ?? 0 ))
885+ return Math .max (1 , len)
883886})
884887
885888function selectMinimapIndex (i ) {
@@ -1941,6 +1944,43 @@ const allScales = computed(() => {
19411944 });
19421945});
19431946
1947+ const interLineAreas = computed (() => {
1948+ const il = FINAL_CONFIG .value .line .interLine || {};
1949+ const pairs = il .pairs || [];
1950+ const colors = il .colors || [];
1951+
1952+ if (! pairs .length ) return [];
1953+
1954+ const out = [];
1955+ pairs .forEach ((pair , i ) => {
1956+ const [nameA , nameB ] = Array .isArray (pair) ? pair : [pair .a , pair .b ];
1957+ if (! nameA || ! nameB) return ;
1958+
1959+ const A = lineSet .value .find (s => s .name === nameA);
1960+ const B = lineSet .value .find (s => s .name === nameB);
1961+ if (! A || ! B || A .type !== ' line' || B .type !== ' line' ) return ;
1962+
1963+ const colorLineA = (colors? .[i]? .[0 ]) ?? A .color ;
1964+ const colorLineB = (colors? .[i]? .[1 ]) ?? B .color ;
1965+
1966+ const areas = buildInterLineAreas ({
1967+ lineA: A .plots ,
1968+ lineB: B .plots ,
1969+ smoothA: !! A .smooth ,
1970+ smoothB: !! B .smooth ,
1971+ colorLineA,
1972+ colorLineB,
1973+ sampleStepPx: 2 ,
1974+ cutNullValues: FINAL_CONFIG .value .line .cutNullValues
1975+ });
1976+
1977+ areas .forEach ((a , j ) => {
1978+ out .push ({ ... a, key: ` inter_${ nameA} _${ nameB} _${ i} _${ j} ` });
1979+ });
1980+ });
1981+ return out;
1982+ });
1983+
19441984/** ****************************************************************************************/
19451985
19461986const dataTooltipSlot = computed (() => {
@@ -2259,8 +2299,6 @@ function convertSizes() {
22592299 })
22602300}
22612301
2262- const debug = computed (() => !! FINAL_CONFIG .value .debug );
2263-
22642302function prepareChart () {
22652303 if (objectIsEmpty (props .dataset )) {
22662304 error ({
@@ -2874,7 +2912,7 @@ defineExpose({
28742912 <!-- ZERO LINE (AFTER BAR DATASETS , BEFORE LABELS ) -->
28752913 < template v- if = " !mutableConfig.useIndividualScale && FINAL_CONFIG.chart.grid.labels.zeroLine.show" >
28762914 < line data- cy= " xy-grid-line-x" : stroke= " FINAL_CONFIG.chart.grid.stroke" stroke- width= " 1"
2877- : x1= " drawingArea.left + xPadding" : x2= " drawingArea.right - xPadding "
2915+ : x1= " drawingArea.left + xPadding" : x2= " drawingArea.right"
28782916 : y1= " forceValidValue(zero)" : y2= " forceValidValue(zero)" stroke- linecap= " round"
28792917 : style= " { animation: 'none !important' }" / >
28802918 < / template>
@@ -2957,8 +2995,8 @@ defineExpose({
29572995 < g v- for = " (yLabel, i) in yLabels" : key= " `yLabel_${i}`" >
29582996 < line data- cy= " axis-y-tick"
29592997 v- if = " canShowValue(yLabel) && yLabel.value >= niceScale.min && yLabel.value <= niceScale.max && FINAL_CONFIG.chart.grid.labels.yAxis.showCrosshairs"
2960- : x1= " drawingArea.left"
2961- : x2= " drawingArea.left - FINAL_CONFIG.chart.grid.labels.yAxis.crosshairSize"
2998+ : x1= " drawingArea.left + xPadding "
2999+ : x2= " drawingArea.left + xPadding - FINAL_CONFIG.chart.grid.labels.yAxis.crosshairSize"
29623000 : y1= " forceValidValue(yLabel.y)" : y2= " forceValidValue(yLabel.y)"
29633001 : stroke= " FINAL_CONFIG.chart.grid.stroke" stroke- width= " 1" stroke- linecap= " round"
29643002 : style= " { animation: 'none !important' }" / >
@@ -3057,6 +3095,20 @@ defineExpose({
30573095 v- bind= " { ...serie, seriesIndex: serie.slotAbsoluteIndex, patternId: `pattern_${uniqueId}_${i}` }" / >
30583096 < / defs>
30593097
3098+ <!-- INTERLINE AREAS (non stack mode only) -->
3099+ < g v- if = " interLineAreas.length && !mutableConfig.isStacked" >
3100+ < path
3101+ v- for = " area in interLineAreas"
3102+ : key= " area.key"
3103+ : d= " area.d"
3104+ : fill= " area.color"
3105+ : fill- opacity= " FINAL_CONFIG.line.interLine.fillOpacity"
3106+ stroke= " none"
3107+ pointer- events= " none"
3108+ : style= " { transition: loading || !FINAL_CONFIG.line.showTransition ? undefined: `all ${FINAL_CONFIG.line.transitionDurationMs}ms ease-in-out`}"
3109+ / >
3110+ < / g>
3111+
30603112 <!-- LINES -->
30613113 < g v- for = " (serie, i) in lineSet" : key= " `serie_line_${i}`" : class = " `serie_line_${i}`"
30623114 : style= " `opacity:${selectedScale ? selectedScale === serie.groupId ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`" >
0 commit comments