Browse Source

Renderer Variablennamen #5

makro_datasrc
Daniel Quathamer 2 years ago
parent
commit
20986bd900
  1. 143
      src-modules/module/viz/conf/viz.xml
  2. 56
      src-modules/module/viz/schluesseltabellen/sx_repository.unl
  3. 40
      src-modules/module/viz/schluesseltabellen/viz_property.unl
  4. 10
      src-modules/module/viz/schluesseltabellen/viz_property_group.unl
  5. 2
      src-modules/module/viz/schluesseltabellen/viz_property_group_renderer.unl
  6. 3
      src-modules/module/viz/schluesseltabellen/viz_property_input_type.unl
  7. 6
      src-modules/module/viz/schluesseltabellen/viz_property_renderer.unl
  8. 6
      src-modules/module/viz/schluesseltabellen/viz_property_unload.x
  9. 6
      src-modules/module/viz/schluesseltabellen/viz_property_upload.x
  10. 2
      src-modules/module/viz/schluesseltabellen/viz_renderer.unl
  11. 6
      superx/style/sx_viz_muster.css
  12. 197
      superx/xml/js/viz/viz_functions.js
  13. 49
      superx/xml/viz_html_chart.xsl

143
src-modules/module/viz/conf/viz.xml

@ -63,6 +63,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/> <column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="uniquename" type="VARCHAR" size="255" default="" notnull="true" description="Unique Name" /> <column name="uniquename" type="VARCHAR" size="255" default="" notnull="true" description="Unique Name" />
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" /> <column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="sortnr" type="INTEGER" size="255" default="" sortable="true" notnull="" description="Sortiernummer" />
</columns> </columns>
<primaryKeys><rs> <primaryKeys><rs>
<row> <row>
@ -163,11 +164,14 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<column name="prop_default" type="VARCHAR" size="255" default="" notnull="false" description="Defaultwert" /> <column name="prop_default" type="VARCHAR" size="255" default="" notnull="false" description="Defaultwert" />
<column name="prop_unit" type="VARCHAR" size="255" default="" notnull="false" description="Einheit" /> <column name="prop_unit" type="VARCHAR" size="255" default="" notnull="false" description="Einheit" />
<column name="is_generic" type="SMALLINT" size="255" default="1" notnull="false" description="Generische Eigenschaft" ><comment>1=ja, 0=nein</comment></column> <column name="is_generic" type="SMALLINT" size="255" default="1" notnull="false" description="Generische Eigenschaft" ><comment>1=ja, 0=nein</comment></column>
<column name="static_values" type="TEXT" size="255" default="" notnull="false" description="Wertebereich (statisch)" ><comment>Mit "|" getrennt</comment></column> <column name="static_values" type="TEXT" size="255" default="" notnull="false" description="Wertebereich (statisch)" ><comment>wird nur bei SELECT-Feldern genutzt, mit "|" getrennt</comment></column>
<column name="is_mandatory" type="SMALLINT" size="255" default="0" notnull="false" description="Pflichteingabe" ><comment>1=ja, 0=nein</comment></column> <column name="is_mandatory" type="SMALLINT" size="255" default="0" notnull="false" description="Pflichteingabe" ><comment>1=ja, 0=nein</comment></column>
<column name="input_type_id" type="INTEGER" size="255" default="1" notnull="false" description="Eingabedialog" ><comment></comment></column> <column name="input_type_id" type="INTEGER" size="255" default="1" notnull="false" description="Eingabedialog" ><comment></comment></column>
<column name="property_group_id" type="INTEGER" size="255" default="" notnull="false" description="Art der Eigenschaft" ><comment></comment></column> <column name="property_group_id" type="INTEGER" size="255" default="" notnull="false" description="Art der Eigenschaft" ><comment></comment></column>
<column name="explanation" type="TEXT" size="32255" default="" notnull="false" description="Erläuterung" ><comment>Wird als Tooltip angezeigt</comment></column> <column name="explanation" type="TEXT" size="32255" default="" notnull="false" description="Erläuterung" ><comment>Wird als Tooltip angezeigt</comment></column>
<column name="sortnr" type="INTEGER" size="255" default="" notnull="" description="Sortiernummer" />
<column name="range_from" type="INTEGER" size="255" default="" notnull="" description="Minimalwert" ><comment>Wir nur bei Schiebereglern genutzt</comment></column>
<column name="range_to" type="INTEGER" size="255" default="" notnull="" description="Maximalwert" ><comment>Wir nur bei Schiebereglern genutzt</comment></column>
@ -209,6 +213,54 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<indexes> <indexes>
</indexes> </indexes>
</table> </table>
<table name="viz_property_renderer" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Schlüsseltabelle für Renderer von Visualisierungseigenschaften</description>
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="renderer_id" type="INTEGER" size="" default="" notnull="true" description="Renderer" isKey="true"/>
<column name="property_id" type="INTEGER" size="255" default="" notnull="true" description="Eigenschaft der Visualisierung" isKey="true" />
<column name="variable_name" type="VARCHAR" size="255" default="" notnull="" description="Variablenname" />
</columns>
<primaryKeys><rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>viz_property_renderer</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>viz_property_renderer_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>
<table name="viz_property_group_renderer" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Schlüsseltabelle für Renderer von Gruppen von Visualisierungseigenschaften</description>
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="renderer_id" type="INTEGER" size="" default="" notnull="true" description="Renderer" isKey="true"/>
<column name="property_group_id" type="INTEGER" size="255" default="" notnull="true" description="Gruppe der Visualisierung" isKey="true"/>
<column name="variable_name" type="VARCHAR" size="255" default="" notnull="" description="Variablenname" />
</columns>
<primaryKeys><rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>viz_property_group_renderer</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>viz_property_group_renderer_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>
<views> <views>
</views> </views>
@ -264,6 +316,24 @@ parent="Masken verwalten">Abfragen zur Administration von Visualisierungen </the
displayType="select" visibleFields="caption" format="%s"> displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="property_group_id" /> <relation-column from="tid" to="property_group_id" />
</relation> </relation>
<!--viz_property_group_renderer-->
<relation from="viz_property_group" to="viz_property_group_renderer" delete="FALSE"
displayType="select" visibleFields="variable_name" format="%s">
<relation-column from="tid" to="property_group_id" />
</relation>
<relation from="viz_renderer" to="viz_property_group_renderer" delete="FALSE"
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="renderer_id" />
</relation>
<!--viz_property_renderer-->
<relation from="viz_property" to="viz_property_renderer" delete="FALSE"
displayType="select" visibleFields="variable_name" format="%s">
<relation-column from="tid" to="property_id" />
</relation>
<relation from="viz_renderer" to="viz_property_renderer" delete="FALSE"
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="renderer_id" />
</relation>
</data-integrity> </data-integrity>
@ -381,7 +451,7 @@ mode="full">
path="/edit/viz/viz_property_list.jsp" path="/edit/viz/viz_property_list.jsp"
followUp="" followUp=""
caption="Diagrammeigenschaften verwalten" caption="Diagrammeigenschaften verwalten"
orderBy="name" orderBy="caption"
gotoHt="" gotoHt=""
helpfile="" helpfile=""
maxRows="*" maxRows="*"
@ -393,7 +463,8 @@ mode="full">
<customfield name="tid" nullFieldValue="" /> <customfield name="tid" nullFieldValue="" />
<customfield name="property_group_id" visibleSize="10" nullFieldValue="" /> <customfield name="property_group_id" visibleSize="10" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" /> <customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" /> <customfield name="prop_uniquename" nullFieldValue="" visibleSize="30" />
<customfield name="sortnr" nullFieldValue="" visibleSize="5" />
<customfield type="link" name="Details" path="/superx/edit/viz/viz_property_edit.jsp" linkid="tid"/> <customfield type="link" name="Details" path="/superx/edit/viz/viz_property_edit.jsp" linkid="tid"/>
</form> </form>
<form name="viz_property_edit" <form name="viz_property_edit"
@ -421,16 +492,28 @@ mode="full">
<customfield name="is_mandatory" visibleSize="10" nullFieldValue="" /> <customfield name="is_mandatory" visibleSize="10" nullFieldValue="" />
<customfield name="input_type_id" visibleSize="10" nullFieldValue="" /> <customfield name="input_type_id" visibleSize="10" nullFieldValue="" />
<customfield name="static_values" visibleSize="80" nullFieldValue="" /> <customfield name="static_values" visibleSize="80" nullFieldValue="" />
<customfield name="range_from" visibleSize="80" nullFieldValue="" />
<customfield name="range_to" visibleSize="80" nullFieldValue="" />
<customfield name="property_group_id" visibleSize="10" nullFieldValue="" /> <customfield name="property_group_id" visibleSize="10" nullFieldValue="" />
<customfield name="explanation" visibleSize="80" nullFieldValue="" /> <customfield name="explanation" visibleSize="80" nullFieldValue="" />
<customfield name="sortnr" nullFieldValue="" visibleSize="5" />
<customfield name="Renderer" type="subform" multipart="false" autoUpdate="false"
maxRows="*" table="viz_property_renderer" parentField="tid" childField="property_id"
orderBy="variable_name" allowNew="true"
mode="full">
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="property_id" type="hidden" overrideValue="tid" />
<customfield name="renderer_id" nullFieldValue="" visibleSize="30" />
<customfield name="variable_name" visibleSize="50" nullFieldValue="" />
</customfield>
</form> </form>
<form name="viz_property_group_list" <form name="viz_property_group_list"
table="viz_property_group" table="viz_property_group"
path="/edit/viz/viz_property_group_list.jsp" path="/edit/viz/viz_property_group_list.jsp"
followUp="" followUp=""
caption="Diagrammgruppen-Eigenschaften verwalten" caption="Diagrammgruppen-Eigenschaften verwalten"
orderBy="name" orderBy="sortnr"
gotoHt="" gotoHt=""
helpfile="" helpfile=""
maxRows="*" maxRows="*"
@ -442,7 +525,57 @@ mode="full">
<customfield name="tid" nullFieldValue="" /> <customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" /> <customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" /> <customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield name="sortnr" nullFieldValue="" visibleSize="5" />
<customfield type="link" name="Details" path="/superx/edit/viz/viz_property_group_edit.jsp" linkid="tid"/>
</form> </form>
<form name="viz_property_group_edit"
table="viz_property_group"
path="/edit/viz/viz_property_group_edit.jsp"
followUp=""
caption="Diagrammgruppen-Eigenschaften verwalten"
orderBy="name"
gotoHt=""
helpfile=""
maxRows="1"
mode="full">
<description>In diesem Formular können Sie Gruppen von Diagrammeigenschaften verwalten. </description>
<filters>
</filters>
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield name="sortnr" nullFieldValue="" visibleSize="5" />
<customfield name="Renderer" type="subform" multipart="false" autoUpdate="false"
maxRows="*" table="viz_property_group_renderer" parentField="tid" childField="property_group_id"
orderBy="variable_name" allowNew="true"
mode="full">
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="property_group_id" type="hidden" overrideValue="tid" />
<customfield name="renderer_id" nullFieldValue="" visibleSize="30" />
<customfield name="variable_name" visibleSize="50" nullFieldValue="" />
</customfield>
</form>
<form name="viz_renderer_list"
table="viz_renderer"
path="/edit/viz/viz_renderer_list.jsp"
followUp=""
caption="Diagramm-Renderer verwalten"
orderBy="caption"
gotoHt=""
helpfile=""
maxRows="*"
mode="full">
<description>In diesem Formular können Sie Diagramm-Renderer verwalten. </description>
<filters>
</filters>
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
</form>
</dbforms> </dbforms>
</module> </module>

56
src-modules/module/viz/schluesseltabellen/sx_repository.unl

@ -1,22 +1,56 @@
1^CUSTOMXMLADD^<sqlvars> <sqlvar name="commonChartProperties" type="hash">\ 1^CUSTOMXMLADD^<sqlvars> <sqlvar name="commonChartProperties" type="hash">\
SELECT tid,\ \
caption,\ SELECT \
prop_uniquename,\ P.tid,\
prop_default,\ P.caption,\
prop_unit\ P.prop_uniquename,\
\ P.prop_default,\
FROM viz_property \ P.prop_unit,\
where is_generic=1\ P.is_generic,\
P.static_values,\
P.is_mandatory,\
P.explanation,\
P.sortnr,\
P.range_from,\
P.range_to,\
T.caption as input_type_caption,\
T.uniquename as input_type_uniquename,\
G.caption as group_caption,\
G.sortnr as group_sortnr,\
G.uniquename as group_uniquename,\
R.uniquename as renderer_uniquename,\
GR.variable_name as group_variable_name,\
PR.variable_name \
\
FROM viz_property_input_type T, viz_property P left outer join viz_property_group G\
on (P.property_group_id=G.tid)\
left outer join viz_property_group_renderer GR on (GR.property_group_id=G.tid)\
left outer join viz_property_renderer PR on (P.tid=PR.property_id)\
left outer join viz_renderer R on (R.tid=PR.renderer_id)\
where T.tid=P.input_type_id\
and P.is_generic=1\
order by G.sortnr,G.uniquename,P.sortnr,P.caption\
;\ ;\
</sqlvar> </sqlvars>\ </sqlvar> </sqlvars>\
<chartProperties>\ <chartProperties>\
<#if commonChartProperties?is_sequence><#foreach cp in commonChartProperties>\ <\if commonChartProperties?is_sequence><\foreach cp in commonChartProperties>\
<commonChartProperty tid="${cp.tid}" \ <commonChartProperty tid="${cp.tid}" \
caption="${cp.caption}" \ caption="${cp.caption}" \
prop_uniquename="${cp.prop_uniquename}" \ prop_uniquename="${cp.prop_uniquename}" \
prop_default="${cp.prop_default}" \ prop_default="${cp.prop_default}" \
static_values="${cp.static_values}" \
input_type_uniquename="${cp.input_type_uniquename}" \
group_caption="${cp.group_caption}" \
group_uniquename="${cp.group_uniquename}" \
prop_unit="${cp.prop_unit}" \ prop_unit="${cp.prop_unit}" \
prop_range_from="${cp.range_from}" \
prop_range_to="${cp.range_to}" \
renderer_uniquename="${cp.renderer_uniquename}" \
group_variable_name="${cp.group_variable_name}" \
variable_name="${cp.variable_name}" \
\
\
/>\ />\
</#foreach>\ </\foreach>\
</#if>\ </\if>\
</chartProperties>^Chart-Eigenschaften^Hier werden Chart-Eigenschaften gefiltert^^VIZ_PROPERTIES^^^320^1^0^0^^1^01.01.1900^31.12.3000^ </chartProperties>^Chart-Eigenschaften^Hier werden Chart-Eigenschaften gefiltert^^VIZ_PROPERTIES^^^320^1^0^0^^1^01.01.1900^31.12.3000^

40
src-modules/module/viz/schluesseltabellen/viz_property.unl

@ -1,10 +1,30 @@
1^Höhe^height^500^px^1^^0^1^1^^ 1^Diagramm-Höhe^height^500^px^1^^0^1^10^(Wird nur ausgewertet wenn es keine Y-Achse gibt)^^^^
3^Werte-Label Breite^valueLabelWidth^20^px^1^^0^1^4^^ 2^Diagramm-Breite^chartWidth^600^px^1^^0^1^10^Äußere Breite des Diagramms inkl. Ränder^^100^2000^
8^Füllfarbe^fill^blue^ ^1^ ^0^1^3^^ 3^Werte-Label-Breite^valueLabelWidth^20^px^1^^0^1^10^^^^^
9^Grid-Label Höhe^gridLabelHeight^18^ ^1^ ^0^1^4^^ 4^Hintergrundfarbe^backgroundColor^#ffffeb^ ^1^ ^0^1^11^^^^^
10^Grid Offset^gridChartOffset^3^ ^1^ ^0^1^4^^ 5^Vordergrundfarbe^color^#3333ff^ ^1^ ^0^1^11^Text- und Diagrammelemente^^^^
2^Breite^chartWidth^600^px^1^^0^1^1^^ 6^Schriftgröße^fontSize^10^pt^1^^0^1^11^Text- und Diagrammelemente^^^^
7^Schriftfamilie^fontFamily^sans-serif^ ^1^sans-serif|serif|monospace^0^2^4^^ 7^Schriftfamilie^fontFamily^sans-serif^ ^1^sans-serif|serif|monospace^0^2^11^^^^^
6^Schriftgröße^fontSize^10^pt^1^^0^1^4^Text- und Diagrammelemente^ 8^Flächenfarbe^fill^blue^ ^1^ ^0^1^12^^^^^
4^Hintergrundfarbe^background-color^#ffffeb^ ^1^^0^1^4^^ 9^Grid-Label-Höhe^gridLabelHeight^18^ ^1^ ^0^1^10^^^^^
5^Vordergrundfarbe^color^#3333ff^ ^1^^0^1^4^Text- und Diagrammelemente^ 10^Grid-Offset^gridChartOffset^3^ ^1^ ^0^1^10^^^^^
11^tickRotate^tickRotate^-45^ ^0^ ^0^1^5^^^^^
12^ticks^Einheit X-Achse^5^ ^0^ ^0^1^5^^^^^
13^tickSize^Abstand X-Achse und Beschriftung^10^ ^0^ ^0^1^5^^^^^
14^labelOffset^Abstand X-Achse Beschriftung^10^ ^0^ ^0^1^5^^^^^
15^Ausrichtung X-Achse Beschriftung^labelAnchor^center^ ^0^left|center|right^0^2^5^^^^^
16^Außenrand links^^^^1^^0^1^10^^^^^
17^Außenrand rechts^^^^1^^0^1^10^^^^^
18^Außenrand oben^^^^1^^0^1^10^^^^^
19^Außenrand unten^^^^1^^0^1^10^^^^^
20^Innenrand oben^^^^1^^0^1^10^^^^^
21^Innenrand unten^^^^1^^0^1^10^^^^^
22^Innenrand links^^^^1^^0^1^10^^^^^
23^Innenrand rechts^^^^1^^0^1^10^^^^^
24^Farbschema^scale.scheme^ ^ ^1^blues|greens^0^2^12^^^^^
25^Farbtyp^^^^1^^0^1^12^^^^^
43^Farbsättigung^^^^1^^0^1^12^^^^^
44^Strichfarbe^stroke^ ^ ^1^ ^0^1^12^^^^^
45^Strichdicke^strokeWidth^ ^ ^1^ ^0^1^12^^^^^
47^Werte X-Achse^Plot.groupX^ ^ ^1^Anzahl|Summe|Proportion|Minimum|Maximum|Durchschnitt|Varianz|Erster|Letzter^0^2^14^^^^^
55^Werte Y-Achse^Plot.groupY^ ^ ^1^Anzahl|Summe|Proportion|Minimum|Maximum|Durchschnitt|Varianz|Erster|Letzter^0^2^14^^^^^

10
src-modules/module/viz/schluesseltabellen/viz_property_group.unl

@ -1,4 +1,6 @@
1^SIZE^Grafikgröße^ 5^X^X-Achse^50^
2^MARGIN^Abstände^ 6^Y^Y-Achse^40^
3^COLOR^Farben^ 10^LAYOUT^Diagramm-Layout^10^
4^STYLES^Elementformatierung^ 11^STYLE^Diagramm-Style^20^
12^ELEMENTS^Diagramm-Elemente^30^
14^DATACATEGORY^Wertekategorien^60^

2
src-modules/module/viz/schluesseltabellen/viz_property_group_renderer.unl

@ -0,0 +1,2 @@
1^2^11^style^
2^2^10^ ^

3
src-modules/module/viz/schluesseltabellen/viz_property_input_type.unl

@ -1,4 +1,5 @@
1^TEXT^Texteingabe^ 1^TEXT^Texteingabe^
2^SELECT^Select-Liste^ 2^SELECT^Select-Liste^
3^COLOR^Farbauswahl^ 3^COLOR^Farbauswahl^
4^LEVER^Schieberegler^ 4^RANGE^Schieberegler^
5^TEXTAREA^Großes Textfeld^

6
src-modules/module/viz/schluesseltabellen/viz_property_renderer.unl

@ -0,0 +1,6 @@
1^2^2^width^
2^2^4^background^
3^2^5^color^
4^2^7^fontFamily^
5^2^6^fontSize^
6^2^1^height^

6
src-modules/module/viz/schluesseltabellen/viz_property_unload.x

@ -0,0 +1,6 @@
DOQUERY "select * from viz_property order by 1,2" false ^ viz_property.unl
DOQUERY "select * from viz_property_input_type order by 1,2" false ^ viz_property_input_type.unl
DOQUERY "select * from viz_property_group order by 1,2" false ^ viz_property_group.unl
DOQUERY "select * from viz_renderer order by 1,2" false ^ viz_renderer.unl
DOQUERY "select * from viz_property_renderer order by 1,2" false ^ viz_property_renderer.unl
DOQUERY "select * from viz_property_group_renderer order by 1,2" false ^ viz_property_group_renderer.unl

6
src-modules/module/viz/schluesseltabellen/viz_property_upload.x

@ -0,0 +1,6 @@
sx_auto_upload_table.x viz_property
sx_auto_upload_table.x viz_property_input_type
sx_auto_upload_table.x viz_property_group
sx_auto_upload_table.x viz_renderer
sx_auto_upload_table.x viz_property_renderer
sx_auto_upload_table.x viz_property_group_renderer

2
src-modules/module/viz/schluesseltabellen/viz_renderer.unl

@ -1,2 +1,2 @@
1^d3js^D3JS^ 1^d3js^D3JS^
2^plot^Observalbe Plot^ 2^plot^Observable Plot^

6
superx/style/sx_viz_muster.css

@ -34,6 +34,12 @@
margin-left: 1.0em; margin-left: 1.0em;
margin-top: 0.4em; } margin-top: 0.4em; }
.select { /*für SELECT Elemente*/
font-family: sans-serif;
font-weight: normal;
width:75px;
}
.control-new { /*für einheitliche Controlbreite*/ .control-new { /*für einheitliche Controlbreite*/
width: 17.0em; width: 17.0em;
} }

197
superx/xml/js/viz/viz_functions.js

@ -160,7 +160,7 @@ function prepareChartProperties(chartType)
return false; return false;
break; break;
} }
renderForm("chartPropertiesForm",chartProperties); renderForm("chartPropertiesForm",chartProperties,commonChartProperties);
renderFormDetails("chartPropertiesFormDetails",commonChartProperties); renderFormDetails("chartPropertiesFormDetails",commonChartProperties);
return true; return true;
@ -366,39 +366,45 @@ function fillSelectionResult(selectionRsMetaData)
} }
function renderForm(formDiv,myChartProperties) function renderForm(formDiv,myChartProperties,myCommonChartProperties)
{ {
//first empty form: //first empty form:
var myForm=document.getElementById(formDiv); var myForm=document.getElementById(formDiv);
while (myForm.firstChild) { while (myForm.firstChild) {
myForm.removeChild(myForm.firstChild); myForm.removeChild(myForm.firstChild);
} }
/* const columnsDiv = document.createElement("div");
const tabElem = document.createElement("table"); columnsDiv.classList.add("columns");
for(var k=0;k < myChartProperties.length;k++) const columnDiv = document.createElement("div");
{ columnDiv.classList.add("column");
const rowElem = document.createElement("tr"); columnDiv.classList.add("is-narrow");
const tdCap = document.createElement("td"); const columnDivBox = document.createElement("div");
const textnode = document.createTextNode(myChartProperties[k].caption); columnDivBox.classList.add("box");
tdCap.appendChild(textnode); columnDivBox.style="width: 500px";
const tdSelElem = document.createElement("td");
const selElem = document.createElement("select");
selElem.name=myChartProperties[k].name;
selElem.id=myChartProperties[k].name;
fillSelectOptions(selElem,myChartProperties[k].getValueResultset(),myChartProperties[k].isMandatory);
tdSelElem.appendChild(selElem);
rowElem.appendChild(tdCap);
rowElem.appendChild(tdSelElem);
//here values, and then:
tabElem.appendChild( rowElem);
}
myForm.appendChild(tabElem);
*/
for(var k=0;k < myChartProperties.length;k++) for(var k=0;k < myChartProperties.length;k++)
{ {
myForm.appendChild(renderDimensionField(myChartProperties[k])); columnDivBox.appendChild(renderDimensionField(myChartProperties[k]));
} }
columnDiv.appendChild(columnDivBox);
columnsDiv.appendChild(columnDiv);
//title
const columnDivTitle = document.createElement("div");
columnDivTitle.classList.add("column");
columnDivTitle.classList.add("is-narrow");
const columnDivBoxTitle = document.createElement("div");
columnDivBoxTitle.classList.add("box");
columnDivBoxTitle.style="width: 500px";
for(var k=0;k < myCommonChartProperties.length;k++)
{
if(myCommonChartProperties[k].name=="chartCaption")
columnDivBoxTitle.appendChild(renderChartPropertyField(myCommonChartProperties[k]));
}
columnDivTitle.appendChild(columnDivBoxTitle);
columnsDiv.appendChild(columnDivTitle);
myForm.appendChild(columnsDiv);
} }
function renderDimensionField(dimensionProperty) function renderDimensionField(dimensionProperty)
@ -495,7 +501,7 @@ var previousGroup="";
for(var k=0;k < myCommonChartProperties.length;k++) for(var k=0;k < myCommonChartProperties.length;k++)
{ {
var groupUniquename=myCommonChartProperties[k].groupUniquename; var groupUniquename=myCommonChartProperties[k].groupUniquename;
if(groupUniquename != previousGroup) if(groupUniquename!="" && groupUniquename != previousGroup)
{ {
var newcommonChartPropertyGroup = new commonChartPropertyGroup(myCommonChartProperties[k].groupCaption,groupUniquename); var newcommonChartPropertyGroup = new commonChartPropertyGroup(myCommonChartProperties[k].groupCaption,groupUniquename);
commonChartPropertyGroups.push(newcommonChartPropertyGroup); commonChartPropertyGroups.push(newcommonChartPropertyGroup);
@ -553,39 +559,100 @@ function renderChartPropertyField(commonChartProperty)
inputParaElem.classList.add("control-new"); inputParaElem.classList.add("control-new");
const inputElem = document.createElement("div"); const inputElem = document.createElement("div");
inputElem.classList.add("is-small"); inputElem.classList.add("is-small");
inputElem.classList.add("is-fullwidth"); //inputElem.classList.add("is-fullwidth");
if(commonChartProperty.inputType=="TEXT")
{ switch (commonChartProperty.inputType) {
//Einfaches Texteingabefeld: case "SELECT":
const inpElem = document.createElement("input"); //select input:
inpElem.type="TEXT"; inputElem.classList.add("select");
inpElem.size=5; inputElem.classList.add("is-small");
inpElem.title=commonChartProperty.explanation; const selElem = document.createElement("select");
inpElem.name=commonChartProperty.name; selElem.name=commonChartProperty.name;
inpElem.id=commonChartProperty.name; selElem.id=commonChartProperty.name;
inpElem.value=commonChartProperty.defaultValue; selElem.title=commonChartProperty.explanation;
inpElem.onchange= function () { //selElem.style="width:50px";
createChart('chartDiv'); if(commonChartProperty.rendererUniquename=="")
}; {
inputElem.appendChild(inpElem); selElem.disabled="disabled";
inputParaElem.appendChild(inputElem); selElem.readonly="readonly";
}
selElem.onchange= function () {
createChart('chartDiv');
};
fillSelectOptions(selElem,commonChartProperty.getValueResultset(),commonChartProperty.isMandatory);
inputElem.appendChild(selElem);
inputParaElem.appendChild(inputElem);
break;
case "TEXTAREA":
//großes Texteingabefeld:
const textAreaElem = document.createElement("textarea");
textAreaElem.cols="20";
textAreaElem.rows=3;
if(commonChartProperty.rendererUniquename=="")
{
textAreaElem.disabled="disabled";
textAreaElem.readonly="readonly";
}
textAreaElem.title=commonChartProperty.explanation;
textAreaElem.name=commonChartProperty.name;
textAreaElem.id=commonChartProperty.name;
textAreaElem.value=commonChartProperty.defaultValue;
textAreaElem.onchange= function () {
createChart('chartDiv');
};
inputElem.appendChild(textAreaElem);
inputParaElem.appendChild(inputElem);
break;
case "RANGE":
//Einfaches Texteingabefeld:
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.disabled="disabled";
rangeElem.readonly="readonly";
}
rangeElem.title=commonChartProperty.explanation;
rangeElem.name=commonChartProperty.name;
rangeElem.id=commonChartProperty.name;
rangeElem.value=commonChartProperty.defaultValue;
rangeElem.onchange= function () {
createChart('chartDiv');
};
inputElem.appendChild(rangeElem);
inputParaElem.appendChild(inputElem);
break;
default:
//Einfaches Texteingabefeld:
const inpElem = document.createElement("input");
inpElem.type="TEXT";
inpElem.size=5;
if(commonChartProperty.rendererUniquename=="")
{
inpElem.disabled="disabled";
inpElem.readonly="readonly";
}
inpElem.title=commonChartProperty.explanation;
inpElem.name=commonChartProperty.name;
inpElem.id=commonChartProperty.name;
inpElem.value=commonChartProperty.defaultValue;
inpElem.onchange= function () {
createChart('chartDiv');
};
inputElem.appendChild(inpElem);
inputParaElem.appendChild(inputElem);
break;
} }
else
{
//select input:
inputElem.classList.add("select");
const selElem = document.createElement("select");
selElem.name=commonChartProperty.name;
selElem.id=commonChartProperty.name;
selElem.title=commonChartProperty.explanation;
selElem.onchange= function () {
createChart('chartDiv');
};
fillSelectOptions(selElem,commonChartProperty.getValueResultset(),commonChartProperty.isMandatory);
inputElem.appendChild(selElem);
inputParaElem.appendChild(inputElem);
}
inputFieldElem.appendChild(inputParaElem); inputFieldElem.appendChild(inputParaElem);
fieldElem.appendChild(inputFieldElem); fieldElem.appendChild(inputFieldElem);
return fieldElem; return fieldElem;
@ -672,6 +739,10 @@ const tabElem = document.createElement("table");
tabElem.border="1"; tabElem.border="1";
tabElem.width="100%"; tabElem.width="100%";
const rowElem = document.createElement("tr"); const rowElem = document.createElement("tr");
const thCap = document.createElement("th");
const textnode = document.createTextNode("Zeilennr.");
thCap.appendChild(textnode);
rowElem.appendChild(thCap);
for(var col=0;col < metadata.length;col++) for(var col=0;col < metadata.length;col++)
{ {
if(metadata[col].nr) if(metadata[col].nr)
@ -689,6 +760,10 @@ for(row=1;row<rowcount;row++)
if(data[row]) if(data[row])
{ {
const rowElem = document.createElement("tr"); const rowElem = document.createElement("tr");
const tdCap = document.createElement("td");
const textnode = document.createTextNode(row);
tdCap.appendChild(textnode);
rowElem.appendChild(tdCap);
for(var col=0;col < metadata.length;col++) for(var col=0;col < metadata.length;col++)
{ {
if(metadata[col].nr) if(metadata[col].nr)
@ -931,13 +1006,12 @@ function getChartOptions(categoryDim,measureDim,marksArray,chartOrientationVerti
var categoryDim=document.getElementById("dimension1").value; var categoryDim=document.getElementById("dimension1").value;
var measureDim=document.getElementById("measure1").value; var measureDim=document.getElementById("measure1").value;
var fontSizeDefault=getCommonChartProperty("fontSize")+"pt"; var fontSizeDefault=getCommonChartProperty("fontSize")+"pt";
var myCaption=getCommonChartProperty("chartCaption");
var chartWidth=getCommonChartProperty("chartWidth"); var chartWidth=getCommonChartProperty("chartWidth");
var myFontFamily=getCommonChartProperty("font-family"); var myFontFamily=getCommonChartProperty("font-family");
var myBgColor=getCommonChartProperty("background-color"); var myBgColor=getCommonChartProperty("background-color");
var myColor=getCommonChartProperty("color"); var myColor=getCommonChartProperty("color");
var myCaption=getCommonChartProperty("chartCaption"); var marginLeftDefault=chartWidth/5; //20% linker Rand
var marginLeftDefault=chartWidth/5; //20% liner Rand
var marginBottomDefault=100; var marginBottomDefault=100;
var categoryLabel=getColumnCaption(categoryDim); var categoryLabel=getColumnCaption(categoryDim);
var measureLabel=getColumnCaption(measureDim); var measureLabel=getColumnCaption(measureDim);
@ -945,7 +1019,8 @@ function getChartOptions(categoryDim,measureDim,marksArray,chartOrientationVerti
for(var k=0;k < commonChartProperties.length;k++) for(var k=0;k < commonChartProperties.length;k++)
{ {
if(commonChartProperties[k].groupUniquename=="STYLES") if(commonChartProperties[k].name!="" && (commonChartProperties[k].groupUniquename=="STYLE"
|| commonChartProperties[k].groupUniquename=="LAYOUT"))
{ {
stylesString+=",\""+commonChartProperties[k].name+"\":\""+getCommonChartProperty(commonChartProperties[k].name)+"\""; stylesString+=",\""+commonChartProperties[k].name+"\":\""+getCommonChartProperty(commonChartProperties[k].name)+"\"";
} }

49
superx/xml/viz_html_chart.xsl

@ -126,17 +126,36 @@ padding-bottom:10px;
//document.body.append(Plot.plot(options)); //document.body.append(Plot.plot(options));
function commonChartProperty(name,caption,isMandatory,inputType,staticValues,defaultValue,explanation,groupCaption,groupUniquename) function commonChartProperty(name,
caption,
isMandatory,
inputType,
staticValues,
range_from,
range_to,
defaultValue,
explanation,
groupCaption,
groupUniquename,
rendererUniquename,
groupVariableName,
variableName
)
{ {
this.name=name; this.name=name;
this.caption=caption; this.caption=caption;
this.staticValues=staticValues; this.staticValues=staticValues;
this.range_from=range_from;
this.range_to=range_from;
this.isMandatory=isMandatory; this.isMandatory=isMandatory;
this.inputType=inputType; this.inputType=inputType;
this.defaultValue=defaultValue; this.defaultValue=defaultValue;
this.explanation=explanation; this.explanation=explanation;
this.groupCaption=groupCaption; this.groupCaption=groupCaption;
this.groupUniquename=groupUniquename; this.groupUniquename=groupUniquename;
this.rendererUniquename=rendererUniquename;
this.groupVariableName=groupVariableName;
this.variableName=variableName;
this.getValueResultset = function () { this.getValueResultset = function () {
var valueOptions=[]; var valueOptions=[];
var optionCounter=0; var optionCounter=0;
@ -181,6 +200,10 @@ var newCommonChartProperty = new commonChartProperty("</xsl:text>
,"</xsl:text> ,"</xsl:text>
<xsl:value-of select="@static_values" /> <xsl:value-of select="@static_values" />
<xsl:text>","</xsl:text> <xsl:text>","</xsl:text>
<xsl:value-of select="@prop_range_from" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@prop_range_to" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@prop_default" /> <xsl:value-of select="@prop_default" />
<xsl:text>","</xsl:text> <xsl:text>","</xsl:text>
<xsl:value-of select="@explanation" /> <xsl:value-of select="@explanation" />
@ -188,16 +211,36 @@ var newCommonChartProperty = new commonChartProperty("</xsl:text>
<xsl:value-of select="@group_caption" /> <xsl:value-of select="@group_caption" />
<xsl:text>","</xsl:text> <xsl:text>","</xsl:text>
<xsl:value-of select="@group_uniquename" /> <xsl:value-of select="@group_uniquename" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@renderer_uniquename" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@group_variable_name" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@variable_name" />
<xsl:text>"); <xsl:text>");
commonChartProperties.push(newCommonChartProperty); commonChartProperties.push(newCommonChartProperty);
</xsl:text> </xsl:text>
</xsl:for-each> </xsl:for-each>
<xsl:text> <xsl:text>
var newCommonChartProperty = new commonChartProperty("chartCaption","Titel des Diagramms", false,"TEXT", "","</xsl:text> var newCommonChartProperty = new commonChartProperty("chartCaption",
<xsl:value-of select="/ergebnisse/ergebnis/maskenname" /><xsl:text>","wird unter dem Diagramm angezeigt","Diagrammkopf","TITLE"); "Titel des Diagramms",
false,
"TEXTAREA",
"",
"",
"",
"</xsl:text>
<xsl:value-of select="/ergebnisse/ergebnis/maskenname" /><xsl:text>",
"wird unter dem Diagramm angezeigt",
"Diagrammkopf",
"",
"plot",
"",
"");
commonChartProperties.push(newCommonChartProperty); commonChartProperties.push(newCommonChartProperty);
</xsl:text> </xsl:text>
</script> </script>
<script language="Javascript" type="text/javascript" src="../xml/js/viz/viz_functions.js" /> <script language="Javascript" type="text/javascript" src="../xml/js/viz/viz_functions.js" />

Loading…
Cancel
Save