From 4b1041739db5d94e115709f3ce476d58e60ec4a2 Mon Sep 17 00:00:00 2001 From: JooYoung Seo Date: Sun, 7 Jan 2024 22:52:26 -0600 Subject: [PATCH] chore(release): :rocket: build for release --- dist/maidr.js | 42 +++++++++++++++----- dist/maidr.min.js | 2 +- docs/Audio.html | 2 +- docs/BarChart.html | 2 +- docs/BoxPlot.html | 2 +- docs/BoxplotRect.html | 2 +- docs/ChatLLM.html | 16 ++++---- docs/Constants.html | 2 +- docs/Constants_ConvertHexToRGBString.html | 4 +- docs/Constants_ConvertRGBStringToHex.html | 4 +- docs/Constants_GetStyleArrayFromString.html | 4 +- docs/Constants_GetStyleStringFromArray.html | 4 +- docs/Control.html | 2 +- docs/Description.html | 12 +++--- docs/Display.html | 2 +- docs/HeatMap.html | 2 +- docs/HeatMapRect.html | 2 +- docs/Helper.html | 6 +-- docs/Histogram.html | 2 +- docs/Layer0Point.html | 2 +- docs/Layer1Point.html | 2 +- docs/LinePlot.html | 2 +- docs/LogError.html | 14 +++---- docs/Menu.html | 14 +++---- docs/Point.html | 2 +- docs/Position.html | 4 +- docs/Resources.html | 6 +-- docs/Review.html | 6 +-- docs/ScatterPlot.html | 2 +- docs/Segmented.html | 2 +- docs/Tracker.html | 18 ++++----- docs/audio.js.html | 2 +- docs/barplot.js.html | 2 +- docs/boxplot.js.html | 2 +- docs/constants.js.html | 44 ++++++++++++++++----- docs/controls.js.html | 2 +- docs/display.js.html | 2 +- docs/global.html | 2 +- docs/heatmap.js.html | 2 +- docs/histogram.js.html | 2 +- docs/index.html | 2 +- docs/init.js.html | 2 +- docs/lineplot.js.html | 2 +- docs/scatterplot.js.html | 2 +- docs/segmented.js.html | 2 +- 45 files changed, 153 insertions(+), 105 deletions(-) diff --git a/dist/maidr.js b/dist/maidr.js index 8bc28924..a50753f4 100644 --- a/dist/maidr.js +++ b/dist/maidr.js @@ -74,13 +74,14 @@ class Constants { visualBraille = false; // do we want to represent braille based on what's visually there or actually there. Like if we have 2 outliers with the same position, do we show 1 (visualBraille true) or 2 (false) globalMinMax = true; ariaMode = 'assertive'; // assertive (default) / polite + playLLMWaitingSound = true; // LLM settings - hasChatLLM = true; LLMDebugMode = 0; // 0 = use real data, 1 = all fake, 2 = real data but no image authKey = null; // OpenAI authentication key, set in menu LLMmaxResponseTokens = 1000; // max tokens to send to LLM, 20 for testing, 1000 ish for real LLMDetail = 'high'; // low (default for testing, like 100 tokens) / high (default for real, like 1000 tokens) + skillLevel = 'basic'; // basic / intermediate / expert // user controls (not exposed to menu, with shortcuts usually) showDisplay = 1; // true / false @@ -403,15 +404,20 @@ class Menu { constants.ariaMode == 'polite' ? 'checked' : '' }>

- ${ - constants.hasChatLLM - ? '

' - : '' - } + +

+

+ + +

@@ -543,6 +549,7 @@ class Menu { if (typeof constants.authKey == 'string') { document.getElementById('chatLLM_auth_key').value = constants.authKey; } + document.getElementById('skill_level').value = constants.skillLevel; // aria mode if (constants.ariaMode == 'assertive') { @@ -570,6 +577,7 @@ class Menu { constants.keypressInterval = document.getElementById('keypress_interval').value; constants.authKey = document.getElementById('chatLLM_auth_key').value; + constants.skillLevel = document.getElementById('skill_level').value; // aria if (document.getElementById('aria_mode_assertive').checked) { @@ -616,6 +624,7 @@ class Menu { data.keypressInterval = constants.keypressInterval; data.ariaMode = constants.ariaMode; data.authKey = constants.authKey; + data.skillLevel = constants.skillLevel; localStorage.setItem('settings_data', JSON.stringify(data)); } /** @@ -634,6 +643,7 @@ class Menu { constants.keypressInterval = data.keypressInterval; constants.ariaMode = data.ariaMode; constants.authKey = data.authKey; + constants.skillLevel = data.skillLevel; } this.PopulateData(); this.UpdateHtml(); @@ -787,7 +797,7 @@ class ChatLLM { let xhr = new XMLHttpRequest(); // start waiting sound - if (constants.sonifMode != 'off') { + if (constants.playLLMWaitingSound) { chatLLM.WaitingSound(true); } @@ -1127,7 +1137,21 @@ class ChatLLM { //let img = await this.ConvertSVGtoImg(singleMaidr.id); let img = await this.ConvertSVGtoJPG(singleMaidr.id); //this.downloadJPEG(img, 'test.jpg'); // test download - let text = 'Describe this chart'; + let text = 'Describe this chart to a blind person'; + if (constants.skillLevel) { + text += + ' who has a ' + + constants.skillLevel + + ' understanding of statistical charts. '; + } else { + text += ' who has a basic understanding of statistical charts. '; + } + text += 'Here is chart in png format'; + if (singleMaidr) { + text += ' and raw data in json format: \n'; + text += JSON.stringify(singleMaidr); + } + chatLLM.Submit(text, img); } } diff --git a/dist/maidr.min.js b/dist/maidr.min.js index 2b223da2..764a08c1 100644 --- a/dist/maidr.min.js +++ b/dist/maidr.min.js @@ -1 +1 @@ -class Constants{chart_container_id="chart-container";main_container_id="maidr-container";braille_container_id="braille-div";braille_input_id="braille-input";info_id="info";announcement_container_id="announcements";end_chime_id="end_chime";container_id="container";project_id="maidr";review_id_container="review_container";review_id="review";reviewSaveSpot;reviewSaveBrailleMode;chartId="";events=[];postLoadEvents=[];constructor(){}textMode="verbose";brailleMode="off";sonifMode="on";reviewMode="off";minX=0;maxX=0;minY=0;maxY=0;plotId="";chartType="";navigation=1;MAX_FREQUENCY=1e3;MIN_FREQUENCY=200;NULL_FREQUENCY=100;combinedVolMin=.25;combinedVolMax=1.25;MAX_SPEED=500;MIN_SPEED=50;DEFAULT_SPEED=250;INTERVAL=20;AUTOPLAY_DURATION=5e3;vol=.5;MAX_VOL=30;autoPlayRate=this.DEFAULT_SPEED;colorSelected="#03C809";brailleDisplayLength=32;showRect=1;hasRect=1;hasSmooth=1;duration=.3;outlierDuration=.06;autoPlayOutlierRate=50;autoPlayPointsRate=50;colorUnselected="#595959";isTracking=1;visualBraille=!1;globalMinMax=!0;ariaMode="assertive";hasChatLLM=!0;LLMDebugMode=0;authKey=null;LLMmaxResponseTokens=1e3;LLMDetail="high";showDisplay=1;showDisplayInBraille=1;showDisplayInAutoplay=0;outlierInterval=null;isMac=navigator.userAgent.toLowerCase().includes("mac");control=this.isMac?"Cmd":"Ctrl";alt=this.isMac?"option":"Alt";home=this.isMac?"fn + Left arrow":"Home";end=this.isMac?"fn + Right arrow":"End";keypressInterval=2e3;tabMovement=null;debugLevel=3;canPlayEndChime=!1;manualData=!0;KillAutoplay(){this.autoplayId&&(clearInterval(this.autoplayId),this.autoplayId=null)}KillSepPlay(){this.sepPlayId&&(clearInterval(this.sepPlayId),this.sepPlayId=null)}SpeedUp(){constants.autoPlayRate-this.INTERVAL>this.MIN_SPEED&&(constants.autoPlayRate-=this.INTERVAL)}SpeedDown(){constants.autoPlayRate+this.INTERVAL<=this.MAX_SPEED&&(constants.autoPlayRate+=this.INTERVAL)}SpeedReset(){constants.autoPlayRate=constants.DEFAULT_SPEED}ConvertHexToRGBString(t){return"rgb("+parseInt(t.slice(1,3),16)+","+parseInt(t.slice(3,5),16)+","+parseInt(t.slice(5,7),16)+")"}ConvertRGBStringToHex(t){let e=t.replace(/[^\d,]/g,"").split(",");return"#"+e[0].toString(16).padStart(2,"0")+e[1].toString(16).padStart(2,"0")+e[2].toString(16).padStart(2,"0")}ColorInvert(t){let e=t.replace(/[^\d,]/g,"").split(",");return"rgb("+(255-e[0])+","+(255-e[1])+","+(255-e[2])+")"}GetBetterColor(t){-1!==t.indexOf("#")&&(t=this.ConvertHexToRGBString(t));let e=this.ColorInvert(t),n=e.replace(/[^\d,]/g,"").split(",");return n[1]n[0]-10&&n[2]n[0]-10&&(n[0]>86||n[0]<169)&&(e=this.colorSelected),e}GetStyleArrayFromString(t){return t.replaceAll(" ","").split(/[:;]/)}GetStyleStringFromArray(t){let e="";for(let n=0;n