@@ -17065,7 +17065,7 @@ ${properties}`
1706517065 }
1706617066 }
1706717067
17068- ImportanceChart2[FILENAME] = 'src/ce_mlflow_extension /templates/components/ImportanceChart2.svelte';
17068+ ImportanceChart2[FILENAME] = 'src/xaiflow /templates/components/ImportanceChart2.svelte';
1706917069
1707017070 var root$4 = add_locations(from_html(`<div class="importance-chart-container"><canvas class="svelte-ec5xpb"></canvas></div>`), ImportanceChart2[FILENAME], [[236, 0, [[237, 2]]]]);
1707117071
@@ -17333,7 +17333,7 @@ ${properties}`
1733317333 return pop({ ...legacy_api() });
1733417334 }
1733517335
17336- ScatterShapValues[FILENAME] = 'src/ce_mlflow_extension /templates/components/ScatterShapValues.svelte';
17336+ ScatterShapValues[FILENAME] = 'src/xaiflow /templates/components/ScatterShapValues.svelte';
1733717337
1733817338 var root$3 = add_locations(from_html(`<div class="scatter-shap-container"><canvas class="svelte-ec5xpb"></canvas></div>`), ScatterShapValues[FILENAME], [[237, 0, [[238, 2]]]]);
1733917339
@@ -17581,7 +17581,7 @@ ${properties}`
1758117581 return pop({ ...legacy_api() });
1758217582 }
1758317583
17584- ChartManager[FILENAME] = 'src/ce_mlflow_extension /templates/components/ChartManager.svelte';
17584+ ChartManager[FILENAME] = 'src/xaiflow /templates/components/ChartManager.svelte';
1758517585
1758617586 var root$2 = add_locations(from_html(`<div class="chart-manager svelte-169j5gc"><div class="charts-row svelte-169j5gc"><div class="chart-section svelte-169j5gc"><h3 class="svelte-169j5gc">Feature Importance Chart</h3> <div class="chart-container svelte-169j5gc"><!></div></div> <div class="chart-section svelte-169j5gc"><h3 class="svelte-169j5gc">SHAP Values</h3> <div class="chart-container svelte-169j5gc"><!></div></div></div></div>`), ChartManager[FILENAME], [
1758717587 [
@@ -19112,9 +19112,9 @@ ${properties}`
1911219112 });
1911319113 }
1911419114
19115- DeepDiveChart[FILENAME] = 'src/ce_mlflow_extension /templates/components/DeepDiveChart.svelte';
19115+ DeepDiveChart[FILENAME] = 'src/xaiflow /templates/components/DeepDiveChart.svelte';
1911619116
19117- var root$1 = add_locations(from_html(`<canvas class="svelte-1mf6xd3"></canvas>`), DeepDiveChart[FILENAME], [[427 , 2]]);
19117+ var root$1 = add_locations(from_html(`<canvas class="svelte-1mf6xd3"></canvas>`), DeepDiveChart[FILENAME], [[404 , 2]]);
1911819118
1911919119 function DeepDiveChart($$anchor, $$props) {
1912019120 check_target(new.target);
@@ -19173,11 +19173,26 @@ ${properties}`
1917319173 let cumulativeValues;
1917419174 let maxCumulativeValue;
1917519175
19176+ function getScreenSizeFlags() {
19177+ const width = window.innerWidth;
19178+
19179+ return {
19180+ isSmallScreen: width < 768,
19181+ isMediumScreen: width >= 768 && width < 1560,
19182+ isLargeScreen: width >= 1560,
19183+ isXLargeScreen: width >= 1980
19184+ };
19185+ }
19186+
1917619187 function updateChart(singleShapValues) {
1917719188 console.log(...log_if_contains_state('log', "updateChart called with singleShapValues:", singleShapValues, "and singleFeatureValues:", get(singleFeatureValues)));
1917819189 maxOfData = Math.max(...singleShapValues);
1917919190 minOfData = Math.min(...singleShapValues);
1918019191
19192+ const screen = getScreenSizeFlags();
19193+
19194+ console.log(...log_if_contains_state('log', "Screen size flags:", screen));
19195+
1918119196 // Color mapping based on isHigherOutputBetter prop
1918219197 pointBackgroundColor = singleShapValues.map((d) => {
1918319198 const normalizedValue = (d - minOfData) / (maxOfData - minOfData) * 100;
@@ -19200,54 +19215,45 @@ ${properties}`
1920019215 chart.data.datasets[0].data = cumulativeValues;
1920119216 maxCumulativeValue = Math.max(...cumulativeValues.map((d) => d[1]));
1920219217 console.log(...log_if_contains_state('log', "Max Cumulative Value", maxCumulativeValue));
19203-
19204- // chart.data.datasets[0].data[0][0] += base_value;
1920519218 chart.data.datasets[0].backgroundColor = pointBackgroundColor;
1920619219
1920719220 // Update x-axis rotation based on screen size
1920819221 if (chart.options.scales?.x?.ticks) {
19209- const isLargeScreen = window.innerWidth >= 1720 ;
19210- const isMediumScreen = window.innerWidth < 1024 ;
19222+ chart.options.scales.x.ticks.maxRotation = screen.isLargeScreen ? 45 : 90 ;
19223+ chart.options.scales.x.ticks.minRotation = screen.isLargeScreen ? 0 : 90 ;
1921119224
19212- chart.options.scales.x.ticks.maxRotation = isLargeScreen ? 45 : 90;
19213- chart.options.scales.x.ticks.minRotation = isLargeScreen ? 0 : 90;
19214- chart.options.scales.x.ticks.font = { size: window.innerWidth < 768 ? 8 : isMediumScreen ? 10 : 12 };
19225+ chart.options.scales.x.ticks.font = {
19226+ size: screen.isSmallScreen ? 8 : screen.isMediumScreen ? 10 : 12
19227+ };
1921519228 }
1921619229
1921719230 // Update y-axis font size
1921819231 if (chart.options.scales?.y?.ticks) {
19219- const isSmallScreen = window.innerWidth < 768;
19220- const isMediumScreen = window.innerWidth < 1024;
19221-
19222- chart.options.scales.y.ticks.font = { size: isSmallScreen ? 8 : isMediumScreen ? 10 : 12 };
19232+ chart.options.scales.y.ticks.font = {
19233+ size: screen.isSmallScreen ? 8 : screen.isMediumScreen ? 10 : 12
19234+ };
1922319235 }
1922419236
1922519237 // Update layout padding
1922619238 if (chart.options.layout?.padding) {
19227- const isSmallScreen = window.innerWidth < 768;
19228-
1922919239 chart.options.layout.padding = {
19230- top: isSmallScreen ? 40 : 60,
19231- bottom: isSmallScreen ? 5 : 10,
19232- left: isSmallScreen ? 5 : 10,
19233- right: isSmallScreen ? 5 : 10
19240+ top: screen. isSmallScreen ? 40 : 60,
19241+ bottom: screen. isSmallScreen ? 5 : 10,
19242+ left: screen. isSmallScreen ? 5 : 10,
19243+ right: screen. isSmallScreen ? 5 : 10
1923419244 };
1923519245 }
1923619246
1923719247 // Update datalabels font size and offset
1923819248 if (chart.options.plugins?.datalabels) {
19239- const isLargeScreen = window.innerWidth >= 1560;
19240- const isSmallScreen = window.innerWidth < 768;
19241- const isMediumScreen = window.innerWidth < 1024;
19242-
19243- chart.options.plugins.datalabels.display = isLargeScreen; // Only show on large screens
19249+ chart.options.plugins.datalabels.display = screen.isLargeScreen || screen.isMediumScreen;
1924419250
1924519251 chart.options.plugins.datalabels.font = {
1924619252 weight: 'bold',
19247- size: isSmallScreen ? 8 : isMediumScreen ? 9 : 10
19253+ size: screen. isSmallScreen ? 8 : screen. isMediumScreen ? 9 : 10
1924819254 };
1924919255
19250- chart.options.plugins.datalabels.offset = isSmallScreen ? 2 : 5;
19256+ chart.options.plugins.datalabels.offset = screen. isSmallScreen ? 2 : 5;
1925119257 }
1925219258
1925319259 chart.update();
@@ -19268,58 +19274,52 @@ ${properties}`
1926819274
1926919275 // Handle screen resize for responsive label rotation
1927019276 function handleResize() {
19271- if (chart && chart.options.scales?.x?.ticks) {
19272- const isLargeScreen = window.innerWidth >= 1560;
19273- const isSmallScreen = window.innerWidth < 768;
19274- const isMediumScreen = window.innerWidth < 1024;
19277+ const screen = getScreenSizeFlags();
1927519278
19276- // Update x-axis
19277- chart.options.scales.x.ticks.maxRotation = isLargeScreen ? 45 : 90;
19279+ console.log(...log_if_contains_state('log', "Handling resize, current screen size flags:", screen));
1927819280
19279- chart.options.scales.x.ticks.minRotation = isLargeScreen ? 0 : 90;
19280- chart.options.scales.x.ticks.font = { size: isSmallScreen ? 8 : isMediumScreen ? 10 : 12 };
19281+ if (chart && chart.options.scales?.x?.ticks) {
19282+ chart.options.scales.x.ticks.maxRotation = screen.isLargeScreen ? 45 : 90;
19283+ chart.options.scales.x.ticks.minRotation = screen.isLargeScreen ? 0 : 90;
19284+
19285+ chart.options.scales.x.ticks.font = {
19286+ size: screen.isSmallScreen ? 8 : screen.isMediumScreen ? 10 : 12
19287+ };
1928119288
1928219289 // Update y-axis
1928319290 if (chart.options.scales?.y?.ticks) {
19284- chart.options.scales.y.ticks.font = { size: isSmallScreen ? 8 : isMediumScreen ? 10 : 12 };
19291+ chart.options.scales.y.ticks.font = {
19292+ size: screen.isSmallScreen ? 8 : screen.isMediumScreen ? 10 : 12
19293+ };
1928519294 }
1928619295
1928719296 // Update layout padding
1928819297 if (chart.options.layout?.padding) {
1928919298 chart.options.layout.padding = {
19290- top: isSmallScreen ? 40 : 60,
19291- bottom: isSmallScreen ? 5 : 10,
19292- left: isSmallScreen ? 5 : 10,
19293- right: isSmallScreen ? 5 : 10
19299+ top: screen. isSmallScreen ? 40 : 60,
19300+ bottom: screen. isSmallScreen ? 5 : 10,
19301+ left: screen. isSmallScreen ? 5 : 10,
19302+ right: screen. isSmallScreen ? 5 : 10
1929419303 };
1929519304 }
1929619305
1929719306 // Update datalabels
1929819307 if (chart.options.plugins?.datalabels) {
19299- chart.options.plugins.datalabels.display = isLargeScreen; // Only show on large screens
19308+ chart.options.plugins.datalabels.display = screen. isLargeScreen || screen.isMediumScreen;
1930019309
1930119310 chart.options.plugins.datalabels.font = {
1930219311 weight: 'bold',
19303- size: isSmallScreen ? 8 : isMediumScreen ? 9 : 10
19312+ size: screen. isSmallScreen ? 8 : screen. isMediumScreen ? 9 : 10
1930419313 };
1930519314
19306- chart.options.plugins.datalabels.offset = isSmallScreen ? 2 : 5;
19315+ chart.options.plugins.datalabels.offset = screen. isSmallScreen ? 2 : 5;
1930719316 }
1930819317
1930919318 chart.update('none'); // Update without animation for smoother resize
1931019319 }
1931119320 }
1931219321
1931319322 onMount(() => {
19314- // sort feature names by featureOrder
19315- // let sortedFeatureNames = explanationSummary.sort((a, b) => b.importance - a.importance).map((d) => d.feature_name);
19316- // let sortedFeatures = modelFeatures.sort((a, b) => sortedFeatureNames.indexOf(a.feature_name) - sortedFeatureNames.indexOf(b.feature_name));
19317- // let sortedIdx = modelFeatures.sort((a, b) => sortedFeatureNames.indexOf(a.feature_name) - sortedFeatureNames.indexOf(b.feature_name)).map((d) => d.feature_order);
19318- // const sortedFeatures = modelFeatures.sort((a, b) => a.feature_order - b.feature_order
19319- // );
19320- //
19321- console.log("DeepDiveChart: onMount called");
19322-
1932319323 maxOfData = Math.max(...get(singleShapValues));
1932419324 minOfData = Math.min(...get(singleShapValues));
1932519325
@@ -19346,7 +19346,7 @@ ${properties}`
1934619346 ]
1934719347 };
1934819348
19349- console.log(...log_if_contains_state('log', "IN DEEPDIVE data", data, $$props.featureNames) );
19349+ const screen = getScreenSizeFlags( );
1935019350
1935119351 const config = {
1935219352 type: 'bar',
@@ -19409,25 +19409,23 @@ ${properties}`
1940919409 },
1941019410
1941119411 datalabels: {
19412- display: window.innerWidth >= 1980 , // Only show on large screens
19412+ display: screen.isLargeScreen || screen.isMediumScreen , // Show on large and medium screens
1941319413 clamp: true,
1941419414 anchor: 'end',
1941519415 align: 'top',
1941619416 color: '#737373',
1941719417
1941819418 font: {
1941919419 weight: 'bold',
19420- size: window.innerWidth < 768 ? 8 : window.innerWidth < 1024 ? 9 : 10
19420+ size: screen.isSmallScreen ? 8 : screen.isMediumScreen ? 9 : 10
1942119421 },
1942219422
19423- offset: window.innerWidth < 768 ? 2 : 5,
19423+ offset: screen.isSmallScreen ? 2 : 5,
1942419424
1942519425 formatter(value, context) {
1942619426 const index = context.dataIndex;
1942719427
1942819428 // const description = featureDescriptions[index]; // Description not needed for datalabel
19429- console.log(...log_if_contains_state('log', "IN DEEPDIVE featureEncodings", featureEncodings(), featureEncodings()[$$props.featureNames[index]]));
19430-
1943119429 let featureValue;
1943219430
1943319431 if (featureEncodings() && featureEncodings()[$$props.featureNames[index]]) {
@@ -19493,7 +19491,7 @@ ${properties}`
1949319491 const featureLines = breakTextIntoLines(featureValueStr, 10);
1949419492
1949519493 // Limit number of lines on small screens
19496- const maxLines = window.innerWidth < 768 ? 2 : 3;
19494+ const maxLines = screen.isSmallScreen ? 2 : 3;
1949719495
1949819496 const displayLines = featureLines.slice(0, maxLines);
1949919497
@@ -19558,7 +19556,7 @@ ${properties}`
1955819556 return pop({ ...legacy_api() });
1955919557 }
1956019558
19561- DeepDiveManager[FILENAME] = 'src/ce_mlflow_extension /templates/components/DeepDiveManager.svelte';
19559+ DeepDiveManager[FILENAME] = 'src/xaiflow /templates/components/DeepDiveManager.svelte';
1956219560
1956319561 var root_1 = add_locations(from_html(`<option> </option>`), DeepDiveManager[FILENAME], [[84, 12]]);
1956419562 var root = add_locations(from_html(`<div><div class="observation-dropdown"><label for="observation-select">Select Observation:</label> <select id="observation-select"></select> <button>Prev</button> <button>Next</button></div> <!></div>`), DeepDiveManager[FILENAME], [[79, 0, [[80, 0, [[81, 4], [82, 4], [87, 4], [88, 4]]]]]]);
0 commit comments