From 4152c7121a189d14596face1ef125fad6fb4b497 Mon Sep 17 00:00:00 2001 From: Daniel Quathamer Date: Wed, 21 Dec 2022 08:33:50 +0100 Subject: [PATCH] Renderer Variablen disabled/enabled #5 --- src-modules/module/viz/conf/viz.xml | 6 +-- superx/xml/js/viz/viz_functions.js | 59 +++++++++++++++------- superx/xml/viz_html_chart.xsl | 78 ----------------------------- 3 files changed, 44 insertions(+), 99 deletions(-) diff --git a/src-modules/module/viz/conf/viz.xml b/src-modules/module/viz/conf/viz.xml index 11158dd..88b7ca1 100644 --- a/src-modules/module/viz/conf/viz.xml +++ b/src-modules/module/viz/conf/viz.xml @@ -359,10 +359,10 @@ parent="Masken verwalten">Abfragen zur Administration von Visualisierungen - + @@ -378,7 +378,7 @@ parent="Masken verwalten">Abfragen zur Administration von Visualisierungen - + diff --git a/superx/xml/js/viz/viz_functions.js b/superx/xml/js/viz/viz_functions.js index 0c4c540..37cb4ed 100644 --- a/superx/xml/js/viz/viz_functions.js +++ b/superx/xml/js/viz/viz_functions.js @@ -571,7 +571,7 @@ function renderChartPropertyField(commonChartProperty) selElem.id=commonChartProperty.name; selElem.title=commonChartProperty.explanation; //selElem.style="width:50px"; - if(commonChartProperty.rendererUniquename=="") + if(commonChartProperty.variableName=="") { selElem.disabled="disabled"; selElem.readonly="readonly"; @@ -590,7 +590,7 @@ function renderChartPropertyField(commonChartProperty) const textAreaElem = document.createElement("textarea"); textAreaElem.cols="20"; textAreaElem.rows=3; - if(commonChartProperty.rendererUniquename=="") + if(commonChartProperty.variableName=="") { textAreaElem.disabled="disabled"; textAreaElem.readonly="readonly"; @@ -608,17 +608,23 @@ function renderChartPropertyField(commonChartProperty) break; case "RANGE": - //Einfaches Texteingabefeld: + //Schieberegler: const rangeElem = document.createElement("input"); - rangeElem.type="RANGE"; - rangeElem.min=commonChartProperty.range_from; - rangeElem.max=commonChartProperty.range_to; - rangeElem.step=50; - if(commonChartProperty.rendererUniquename=="") + rangeElem.type="NUMBER"; + rangeElem.size=5; + if(commonChartProperty.variableName=="") { rangeElem.disabled="disabled"; rangeElem.readonly="readonly"; } + + /* klappt noch nicht: + rangeElem.type="RANGE"; + rangeElem.min=commonChartProperty.range_from; + rangeElem.max=commonChartProperty.range_to; + rangeElem.step=50; + */ + rangeElem.title=commonChartProperty.explanation; rangeElem.name=commonChartProperty.name; rangeElem.id=commonChartProperty.name; @@ -634,7 +640,7 @@ function renderChartPropertyField(commonChartProperty) const inpElem = document.createElement("input"); inpElem.type="TEXT"; inpElem.size=5; - if(commonChartProperty.rendererUniquename=="") + if(commonChartProperty.variableName=="") { inpElem.disabled="disabled"; inpElem.readonly="readonly"; @@ -1007,7 +1013,7 @@ function getChartOptions(categoryDim,measureDim,marksArray,chartOrientationVerti var measureDim=document.getElementById("measure1").value; var fontSizeDefault=getCommonChartProperty("fontSize")+"pt"; var myCaption=getCommonChartProperty("chartCaption"); - var chartWidth=getCommonChartProperty("chartWidth"); + var chartWidth=getCommonChartProperty("width"); var myFontFamily=getCommonChartProperty("font-family"); var myBgColor=getCommonChartProperty("background-color"); var myColor=getCommonChartProperty("color"); @@ -1019,10 +1025,10 @@ function getChartOptions(categoryDim,measureDim,marksArray,chartOrientationVerti for(var k=0;k < commonChartProperties.length;k++) { - if(commonChartProperties[k].name!="" && (commonChartProperties[k].groupUniquename=="STYLE" + if(commonChartProperties[k].variableName!="" && (commonChartProperties[k].groupUniquename=="STYLE" || commonChartProperties[k].groupUniquename=="LAYOUT")) { - stylesString+=",\""+commonChartProperties[k].name+"\":\""+getCommonChartProperty(commonChartProperties[k].name)+"\""; + stylesString+=",\""+commonChartProperties[k].variableName+"\":\""+getCommonChartProperty(commonChartProperties[k].name)+"\""; } } @@ -1090,22 +1096,38 @@ function makeBarX(chartDivElem,selectionRs) { var marksArray=new Array(); if(fillDim=="") marksArray[0]=Plot.barX(selectionRs, + Plot.sort("rownr", { x: measureDim, y: categoryDim, + fill: "blue" - }); + }) + ); else marksArray[0]=Plot.barX(selectionRs, - { + { x: measureDim, y: categoryDim, + //sort: {y: "rownr"}, fill: fillDim - }); + }) + ; var options= getChartOptions(categoryDim,measureDim,marksArray,false); - - document.getElementById(chartDivElem).appendChild(Plot.plot(options)); +/* var svgPlot=Plot.plot({ + y: { + domain: d3.sort(selectionRs, d => -d.rownr).map(d => d.dimension1Value) + }, + x: { + grid: true + }, + marks: [ + Plot.barX(selectionRs, {x: measureDim, y: categoryDim}) + ] +});*/ +var svgPlot=Plot.plot(options); + document.getElementById(chartDivElem).appendChild(svgPlot); } function makeBarY(chartDivElem,selectionRs) { var categoryDim=document.getElementById("viz_dimension1").value; @@ -1145,11 +1167,12 @@ function makeLine(chartDivElem,selectionRs) { x: categoryDim, curve: "linear" }); - marksArray[1]=Plot.dot(rs, + marksArray[1]=Plot.dot(selectionRs, { y: measureDim, x: categoryDim }); + marksArray[2]=Plot.ruleY([0]); var options= getChartOptions(categoryDim,measureDim,marksArray,true); diff --git a/superx/xml/viz_html_chart.xsl b/superx/xml/viz_html_chart.xsl index 0dbd98f..523839a 100644 --- a/superx/xml/viz_html_chart.xsl +++ b/superx/xml/viz_html_chart.xsl @@ -1715,84 +1715,6 @@ rs.push(new dataRow(
- - - - - -