Browse Source

Viewer-XSL, Makroberichte #4

viz_worldmap
Daniel Quathamer 2 years ago
parent
commit
c4355fa476
  1. 48
      src-modules/module/viz/conf/viz.xml
  2. 90
      src-modules/module/viz/masken/44000_maskeninfo.unl
  3. 6
      src-modules/module/viz/schluesseltabellen/sx_stylesheets_einfuegen.sql
  4. 1
      src-modules/module/viz/schluesseltabellen/viz_renderer.unl
  5. 1
      src-modules/module/viz/schluesseltabellen/viz_type.unl
  6. 3
      src-modules/module/viz/schluesseltabellen/viz_type_property.unl
  7. 12
      superx/xml/js/viz/viz_functions.js
  8. 148
      superx/xml/viz_html_chart.xsl
  9. 184
      superx/xml/viz_html_chart_viewer.xsl

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

@ -108,14 +108,21 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
</indexes> </indexes>
</table> </table>
<table name="viz_chart" thema="Visualisierungen" typ="Datentabelle" <table name="viz_chart" thema="Visualisierungen" typ="Datentabelle"
releaseUnload="empty"> releaseUnload="demo">
<description>Diagrammentwürfe</description> <description>Diagrammentwürfe</description>
<columns> <columns>
<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="viz_type_id" type="INTEGER" size="255" default="" notnull="" description="Art des Diagramms" /> <column name="description" type="TEXT" size="255" default="" notnull="" description="Beschreibung" />
<column name="chartmodel" type="TEXT" size="255" default="" notnull="" description="Quellcode des Diagramms" />
<column name="preview_svg" type="TEXT" size="255" default="" notnull="" description="Vorschau (SVG)" /> <column name="preview_svg" type="TEXT" size="255" default="" notnull="" description="Vorschau (SVG)" />
<column name="userinfo_id" type="INTEGER" size="255" default="" notnull="" description="Angelegt von" />
<column name="creation_date" type="DATE" size="255" default="today()" notnull="" description="Angelegt (Datum)" />
<column name="update_date" type="DATE" size="255" default="today()" notnull="" description="Letzte Änderung (Datum)" />
<column name="maskeninfo_id" type="INTEGER" size="255" default="" notnull="" description="Maske" />
<column name="mask_params" type="TEXT" size="255" default="" notnull="" description="Maskenparameter" />
<column name="renderer_id" type="INTEGER" size="" default="" notnull="false" description="Renderer" isKey="true"/>
</columns> </columns>
<primaryKeys><rs> <primaryKeys><rs>
@ -133,7 +140,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
</indexes> </indexes>
</table> </table>
<table name="viz_chart_property" thema="Visualisierungen" typ="Datentabelle" <!--<table name="viz_chart_property" thema="Visualisierungen" typ="Datentabelle"
releaseUnload="empty"> releaseUnload="empty">
<description>Eigenschaften für Diagrammentwürfe</description> <description>Eigenschaften für Diagrammentwürfe</description>
<columns> <columns>
@ -157,7 +164,7 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[VIZ]" />
<indexes> <indexes>
</indexes> </indexes>
</table> </table>-->
<table name="viz_property" thema="Administration" typ="Schlüsseltabelle" <table name="viz_property" thema="Administration" typ="Schlüsseltabelle"
releaseUnload="empty"> releaseUnload="empty">
<description>Schlüsseltabelle für Eigenschaften von Visualisieren</description> <description>Schlüsseltabelle für Eigenschaften von Visualisieren</description>
@ -339,11 +346,20 @@ parent="Visualisierungen">Abfragen zur Administration von Visualisierungen </the
<relation-column from="tid" to="viz_property_id" /> <relation-column from="tid" to="viz_property_id" />
</relation> </relation>
<!--viz_chart--> <!--viz_chart-->
<relation from="viz_type" to="viz_chart" delete="FALSE" <relation from="viz_renderer" to="viz_chart" delete="FALSE"
displayType="select" visibleFields="caption" format="%s"> displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="viz_type_id" /> <relation-column from="tid" to="renderer_id" />
</relation>
<relation from="userinfo" to="viz_chart" delete="FALSE"
displayType="select" visibleFields="name" format="%s">
<relation-column from="tid" to="userinfo_id" />
</relation>
<relation from="maskeninfo" to="viz_chart" delete="FALSE"
displayType="select" visibleFields="name" format="%s">
<relation-column from="tid" to="maskeninfo_id" />
</relation> </relation>
<!--viz_chart_property--> <!--viz_chart_property
<relation from="viz_chart" to="viz_chart_property" delete="FALSE" <relation from="viz_chart" to="viz_chart_property" delete="FALSE"
displayType="select" visibleFields="caption" format="%s"> displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="viz_chart_id" /> <relation-column from="tid" to="viz_chart_id" />
@ -351,7 +367,7 @@ parent="Visualisierungen">Abfragen zur Administration von Visualisierungen </the
<relation from="viz_property" to="viz_chart_property" delete="FALSE" <relation from="viz_property" to="viz_chart_property" delete="FALSE"
displayType="select" visibleFields="caption" format="%s"> displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="viz_property_id" /> <relation-column from="tid" to="viz_property_id" />
</relation> </relation>-->
<!--viz_property--> <!--viz_property-->
<relation from="viz_property_input_type" to="viz_property" delete="FALSE" <relation from="viz_property_input_type" to="viz_property" delete="FALSE"
displayType="select" visibleFields="caption" format="%s"> displayType="select" visibleFields="caption" format="%s">
@ -461,7 +477,7 @@ parent="Visualisierungen">Abfragen zur Administration von Visualisierungen </the
table="viz_chart" table="viz_chart"
path="/edit/viz/viz_chart_list.jsp" path="/edit/viz/viz_chart_list.jsp"
followUp="" followUp=""
caption="Diagramme verwalten" caption="Diagrammentwürfe verwalten"
orderBy="caption" orderBy="caption"
gotoHt="" gotoHt=""
helpfile="" helpfile=""
@ -480,7 +496,7 @@ parent="Visualisierungen">Abfragen zur Administration von Visualisierungen </the
table="viz_chart" table="viz_chart"
path="/edit/viz/viz_chart_edit.jsp" path="/edit/viz/viz_chart_edit.jsp"
followUp="" followUp=""
caption="Diagramme bearbeiten" caption="Diagrammenwürfe bearbeiten"
orderBy="caption" orderBy="caption"
gotoHt="" gotoHt=""
helpfile="" helpfile=""
@ -489,13 +505,18 @@ maxRows="1"
mode="full"> mode="full">
<description>In diesem Formular können Sie Diagramme verwalten.</description> <description>In diesem Formular können Sie Diagramme verwalten.</description>
<filters> <filters>
<filter mandatory="true" type="equals">tid</filter> <filter mandatory="false" type="equals">tid</filter>
<filter mandatory="false" type="equals">created_by</filter>
</filters> </filters>
<field-selection complete="false" /> <field-selection complete="false" />
<customfield name="tid" /> <customfield name="tid" />
<customfield name="caption" visibleSize="50" nullFieldValue="" /> <customfield name="caption" visibleSize="50" nullFieldValue="" />
<customfield name="uniquename" visibleSize="50" nullFieldValue="" /> <customfield name="uniquename" visibleSize="50" nullFieldValue="" />
<customfield name="viz_type_id" visibleSize="10" nullFieldValue="" /> <customfield name="description" visibleSize="50" nullFieldValue="" />
<customfield name="maskeninfo_id" visibleSize="10" nullFieldValue="" />
<customfield name="mask_params" visibleSize="10" nullFieldValue="" />
<customfield name="renderer_id" visibleSize="10" nullFieldValue="" />
<customfield name="chartmodel" visibleSize="10" nullFieldValue="" />
<customfield name="preview_svg" visibleSize="80" nullFieldValue="" /> <customfield name="preview_svg" visibleSize="80" nullFieldValue="" />
</form> </form>
@ -509,6 +530,7 @@ mode="full">
gotoHt="" gotoHt=""
helpfile="" helpfile=""
maxRows="*" maxRows="*"
javascriptFieldsArray="true"
mode="full"> mode="full">
<description>In diesem Formular können Sie Diagrammtypen verwalten. Im Details-Formular können Sie Eigenschaften zuordnen.</description> <description>In diesem Formular können Sie Diagrammtypen verwalten. Im Details-Formular können Sie Eigenschaften zuordnen.</description>
<filters> <filters>
@ -528,7 +550,7 @@ mode="full">
orderBy="caption" orderBy="caption"
gotoHt="" gotoHt=""
helpfile="" helpfile=""
javascriptFieldsArray="true"
maxRows="1" maxRows="1"
mode="full"> mode="full">
<description>In diesem Formular können Sie Diagrammelemente verwalten.</description> <description>In diesem Formular können Sie Diagrammelemente verwalten.</description>

90
src-modules/module/viz/masken/44000_maskeninfo.unl

@ -1,12 +1,85 @@
44000^Visualisierungen verwalten^--Autor: D. Quathamer\ 44000^Visualisierungen verwalten^--Autor: D. Quathamer\
--Datum: 2.8.2019\ --Datum: 2.8.2019\
--freemarker template\ --freemarker template\
create temp table tmp_ergebnis (\
ord smallint,\
tid integer, \
userinfo_id integer,\
benutzer varchar(255),\
caption varchar(255),\
uniquename varchar(255),\
maskeninfo_id integer,\
maskeninfo_name varchar(255),\
nextedit varchar(255)\
);\
insert into tmp_ergebnis (ord,\
tid,\
userinfo_id, \
benutzer,\
caption,\
uniquename,\
maskeninfo_id,\
maskeninfo_name,\
nextedit) \
select 1 as ord,\
C.tid,\
C.userinfo_id,\
nvl(U.name,U.benutzer),\
C.caption,\
C.uniquename,\
C.maskeninfo_id,\
M.name,\
('../edit/viz/viz_chart_edit.jsp|tid=' || C.tid)::varchar(255)\
FROM maskeninfo M, viz_chart C left outer join userinfo U\
on (U.tid=C.userinfo_id)\
where M.tid=C.maskeninfo_id\
/* and C.userinfo_id=<<Benutzer/in>> */\
/* and C.caption ilike '%<<Name>>%' */\
/* and C.uniquename ilike '%<<Schlüssel>>%' */\
/* and C.maskeninfo_id=<<Maske>> */\
\
;\
\
\
insert into tmp_ergebnis (ord,\
--tid,userinfo_id, benutzer,\
caption, --maskeninfo_id,\
--maskeninfo_name,\
-- is_active,\
-- stylesheet_id,\
-- contenttype,\
-- output_filename,\
-- letzter_lauf,\
nextedit) \
select 10, --ord\
'Neuer Eintrag',\
nvl(('../edit/viz/viz_chart_edit.jsp|tid=' || max(tid)+1)::varchar(255),'../edit/viz/viz_chart_edit.jsp'::varchar(255))\
from viz_chart\
--where 0=(select count(*) from qa_mask_execution)\
;\
\
<@selectintotmp \
select="caption,\
uniquename,\
maskeninfo_name,\
benutzer,\
nextedit,\
ord"\
source="tmp_ergebnis"\
target="tmp_ergebnis2">\
order by ord,caption ,uniquename,maskeninfo_name\
</@selectintotmp>\
<@informixnolog/>;\
\
drop table tmp_ergebnis;\
\ \
select \ select \
caption,\ caption,\
uniquename\ uniquename,\
from viz_chart\ maskeninfo_name,\
order by 1\ benutzer,\
nextedit \
from tmp_ergebnis2\
;^XIL List\ ;^XIL List\
drop_and_delete movable_columns sizable_columns horizontal_scrolling\ drop_and_delete movable_columns sizable_columns horizontal_scrolling\
white_space_color=COLOR_WHITE fixed_columns=2\ white_space_color=COLOR_WHITE fixed_columns=2\
@ -17,4 +90,13 @@ Column CID=0 heading_text="Name" center_heading\
Column CID=0 heading_text="Schlüssel" center_heading\ Column CID=0 heading_text="Schlüssel" center_heading\
row_selectable col_selectable heading_platform readonly\ row_selectable col_selectable heading_platform readonly\
width=50 text_size=100\ width=50 text_size=100\
@@@^^^Diagrammtypen und Eigenschaften verwalten^ ^^1^440^360^0^1^^ Column CID=1 heading_text="Maske" center_heading\
row_selectable col_selectable heading_platform readonly\
width=150 text_size=200\
Column CID=1 heading_text="Benutzer/in " center_heading\
row_selectable col_selectable heading_platform readonly\
width=30 text_size=200\
Column CID=1 heading_text="Bearbeiten" center_heading\
row_selectable col_selectable heading_platform readonly\
width=5 text_size=200\
@@@^^^Diagrammtypen und Eigenschaften verwalten^drop table tmp_ergebnis2;^^1^440^360^0^1^^

6
src-modules/module/viz/schluesseltabellen/sx_stylesheets_einfuegen.sql

@ -3,8 +3,6 @@
--Bitte nur Freemarker Variablen füllen --Bitte nur Freemarker Variablen füllen
<#assign masken = [ <#assign masken = [
{"mask":"16000", "filename":"tabelle_html_datenblatt.xsl", "ord":"1"},
{"mask":"16000", "filename":"viz_html_chart.xsl", "ord":"100"},
{"mask":"30220", "filename":"viz_html_chart_sankey.xsl", "ord":"120"}, {"mask":"30220", "filename":"viz_html_chart_sankey.xsl", "ord":"120"},
{"mask":"30220", "filename":"30220_html_chart_sankey.xsl", "ord":"130"} {"mask":"30220", "filename":"30220_html_chart_sankey.xsl", "ord":"130"}
] /> ] />
@ -18,8 +16,8 @@
"is_generic":"1" "is_generic":"1"
}, },
{"filename":"viz_html_chart_sankey.xsl", "caption":"Übergangsdiagramm (Sankey-Diagramm)", "description":"Kreuztabelle Studienanfänger MA und vorheriger BA", "relation":"table", "contenttype":"text/html","is_generic":"0"}, {"filename":"viz_html_chart_sankey.xsl", "caption":"Übergangsdiagramm (Sankey-Diagramm)", "description":"Kreuztabelle Studienanfänger MA und vorheriger BA", "relation":"table", "contenttype":"text/html","is_generic":"0"},
{"filename":"30220_html_chart_sankey.xsl", "caption":"Übergangsdiagramm-Viewer(Sankey-Diagramm)", "description":"Kreuztabelle Studienanfänger MA und vorheriger BA", "relation":"table", "contenttype":"text/html","is_generic":"0"} {"filename":"30220_html_chart_sankey.xsl", "caption":"Übergangsdiagramm-Viewer(Sankey-Diagramm)", "description":"Kreuztabelle Studienanfänger MA und vorheriger BA", "relation":"table", "contenttype":"text/html","is_generic":"0"},
{"filename":"viz_html_chart_viewer.xsl", "caption":"Visualisierung (Viewer)", "description":"Viewer-Stylesheet für VIZ Charts", "relation":"table", "contenttype":"text/html","is_generic":"1"}
] /> ] />
<#assign stylesheet_field = [ <#assign stylesheet_field = [
{"filename":"viz_html_chart_sankey.xsl", "tablename":"erfolg_ba_ma_uebergang", "fieldname":"abschluss_vorher_abschluss"}, {"filename":"viz_html_chart_sankey.xsl", "tablename":"erfolg_ba_ma_uebergang", "fieldname":"abschluss_vorher_abschluss"},

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

@ -1,2 +1,3 @@
1^d3js^D3JS (V7)^ 1^d3js^D3JS (V7)^
2^plot^Observable Plot^ 2^plot^Observable Plot^
3^basic^Basic Shapes^

1
src-modules/module/viz/schluesseltabellen/viz_type.unl

@ -9,3 +9,4 @@
10^text^Wertelabel^2^ ^ ^^ 10^text^Wertelabel^2^ ^ ^^
11^bar_x_d3^Balken (horizontal)^1^^^H^ 11^bar_x_d3^Balken (horizontal)^1^^^H^
12^sankey^Sankey^1^ ^^H^ 12^sankey^Sankey^1^ ^^H^
13^table_bar_x^Tabelle + Balken einfach (horiz.)^3^^^H^

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

@ -384,3 +384,6 @@
404^12^6^10^0^ 404^12^6^10^0^
405^12^7^0^0^ 405^12^7^0^0^
406^12^5^20^0^ 406^12^5^20^0^
407^13^73^1^10^
408^13^95^1^1^
409^13^96^0^5^

12
superx/xml/js/viz/viz_functions.js

@ -336,6 +336,7 @@ function renderChartSVGfromModelWithPlot (currentChartModel,targetDiv)
myOptions["marks"].push(marksArray); myOptions["marks"].push(marksArray);
var svgPlot=Plot.plot(myOptions); var svgPlot=Plot.plot(myOptions);
var srcPlot=JSON.stringify(myOptions); var srcPlot=JSON.stringify(myOptions);
if(document.getElementById("plotCodeTextArea"))
document.getElementById("plotCodeTextArea").innerHTML=srcPlot; document.getElementById("plotCodeTextArea").innerHTML=srcPlot;
document.getElementById(targetDiv).innerHTML=""; document.getElementById(targetDiv).innerHTML="";
document.getElementById(targetDiv).appendChild(svgPlot); document.getElementById(targetDiv).appendChild(svgPlot);
@ -748,6 +749,17 @@ function showChartPropertiesFormDiv(formDiv,formElementsDiv,renderer)
} }
function showSaveChartFormDiv(formDiv,renderer)
{
var myDiv=document.getElementById(formDiv);
if(myDiv.style.display=="block")
myDiv.style.display="none";
else
myDiv.style.display="block";
}
function prepareChartProperties(chartType) function prepareChartProperties(chartType)
{ {
/*OBSOLETE*/ /*OBSOLETE*/

148
superx/xml/viz_html_chart.xsl

@ -224,7 +224,25 @@ commonChartProperties.push(newCommonChartProperty);
</xsl:text>--> </xsl:text>-->
<xsl:text> <xsl:text>
function vizRenderer(uniquename,caption)
{
this.caption=caption;
this.uniquename=uniquename;
}
var vizRenderers=[];
</xsl:text>
<xsl:for-each select="/ergebnisse/ergebnis[@ordnr='0']/ergebniselement/vizRenderers/vizRenderer">
<xsl:text>
var newVizRenderer = new vizRenderer("</xsl:text>
<xsl:value-of select="@uniquename" />
<xsl:text>","</xsl:text>
<xsl:value-of select="@caption" />
<xsl:text>");
vizRenderers.push(newVizRenderer);
</xsl:text>
</xsl:for-each>
<xsl:text>
function vizType(uniquename,caption,rendererUniquename,orientation) function vizType(uniquename,caption,rendererUniquename,orientation)
{ {
this.caption=caption; this.caption=caption;
@ -840,13 +858,9 @@ rs[</xsl:text><xsl:value-of select="$tableId"/><xsl:text>].push(new dataRow_</xs
<p class="control-new"> <p class="control-new">
<div class="select is-small is-fullwidth"> <div class="select is-small is-fullwidth">
<select class="maskinputPflicht" id="fldVizRenderer" NAME="fldVizRenderer" tabindex="1" onChange="resetChartPropertiesForm(this.value);" > <select class="maskinputPflicht" id="fldVizRenderer" NAME="fldVizRenderer" tabindex="1" onChange="resetChartPropertiesForm(this.value);" >
<xsl:if test="$availableRendererPlot='true'"> <xsl:for-each select="/ergebnisse/ergebnis[@ordnr='0']/ergebniselement/vizRenderers/vizRenderer">
<option class="maskinput" value="plot" selected="selected">Observable Plot</option> <option class="maskinput" value="{@uniquename}"><xsl:value-of select="@caption" /></option>
</xsl:if> </xsl:for-each>
<xsl:if test="$availableRendererD3='true'">
<option class="maskinput" value="d3js" >D3JS</option>
</xsl:if>
</select> </select>
</div> </div>
</p> </p>
@ -1079,8 +1093,63 @@ rs[</xsl:text><xsl:value-of select="$tableId"/><xsl:text>].push(new dataRow_</xs
<!--footer (BF nach unten verschoben)--> <!--footer (BF nach unten verschoben)-->
<footer class="card-footer"> <footer class="card-footer">
<p class="card-footer-item"><button class="button is-link is-outlined is-small" type="submit" onClick="alert('noch nicht implementiert)');">Speichern</button></p> <p class="card-footer-item"><button class="button is-link is-outlined is-small" type="submit" onClick="showSaveChartFormDiv('saveChartFormDiv','plot');">Speichern...</button></p>
<p class="card-footer-item"><button class="button is-link is-outlined is-small" type="reset" onClick="return resetChartPropertiesForm('plot');">Zurücksetzen</button></p> <!--<p class="card-footer-item"><button class="button is-link is-outlined is-small" type="reset" onClick="return resetChartPropertiesForm('plot');">Zurücksetzen</button></p>-->
<div id="saveChartFormDiv" style="display:none">
<form name="saveChart" target="_blank" action="../edit/viz/viz_chart_erzeugen.jsp">
<div class="field is-grouped">
<div class="label-container">
<label class="label is-required is-small"><strong>Vorhandene Grafik</strong></label>
</div>
<div class="field is-active">
<p class="control-new">
<div class="select is-small is-fullwidth">
<select class="maskinputPflicht" id="viz_chart_tid" NAME="viz_chart_tid" tabindex="1" >
<xsl:for-each select="/ergebnisse/ergebnis/ergebniselement/viz_charts/viz_chart">
<option class="maskinput" value="{@tid}"><xsl:value-of select="@caption" /></option>
</xsl:for-each>
</select>
</div>
</p>
</div>
<xsl:call-template name="Infobutton" />
</div>
<div class="field is-grouped">
<div class="label-container">
<label class="label is-required is-small"><strong>oder neuer Schlüssel</strong></label>
</div>
<span class="separator">&#160;</span>
<span class="separator">&#160;</span>
<input class="is-small" type="text" size="10" name="viz_chart_uniquename_new" id="viz_chart_uniquename" value="" />
</div>
<div class="field is-grouped">
<div class="label-container">
<label class="label is-required is-small"><strong>Überschrift</strong></label>
</div>
<span class="separator">&#160;</span>
<span class="separator">&#160;</span>
<input class="is-small" type="text" size="20" name="viz_chart_caption" id="viz_chart_caption" value="" />
</div>
<div class="field is-grouped">
<div class="label-container">
<label class="label is-required is-small"></label>
</div>
<span class="separator">&#160;</span>
<span class="separator">&#160;</span>
<input type="submit" class="button is-link is-outlined is-small" value="Speichern"></input>
</div>
</form>
</div>
</footer> </footer>
</xsl:template> </xsl:template>
@ -1168,4 +1237,65 @@ rs[</xsl:text><xsl:value-of select="$tableId"/><xsl:text>].push(new dataRow_</xs
</figure> </figure>
</span> </span>
</xsl:template> </xsl:template>
<xsl:template name="legende_viz">
<xsl:param name="ordnr" />
<xsl:variable name="legendeDivId"><xsl:text>legende</xsl:text><xsl:value-of select="$ordnr" /></xsl:variable>
<p><a>
<xsl:attribute name="onClick"><xsl:text>toggleLegendeDisplay('</xsl:text><xsl:value-of select="$legendeDivId" /><xsl:text>');</xsl:text></xsl:attribute>
<xsl:text>Legende ...</xsl:text></a>
</p>
<div style="display:none">
<xsl:attribute name="id"><xsl:value-of select="$legendeDivId" /></xsl:attribute>
<p class="legende">
<xsl:for-each select="../felder/feld">
<xsl:if test="(value !='' or sicht/@isFirstInGroup='false' or @isstandtoday='false') and @varname != 'sort' and @varname != 'maxoffset' and value_caption != ''">
<span class="feldname">
<xsl:choose>
<xsl:when test="string-length(caption_short) &gt; 0 and caption_short != 'null'" >
<![CDATA[]]><xsl:value-of select="caption_short" /><![CDATA[]]>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@varname" />
</xsl:otherwise>
</xsl:choose></span>:&#160;
<xsl:if test="string-length(value_caption) &lt; 50">
<span class="feldwert"><xsl:value-of select="value_caption" /><![CDATA[]]></span>
</xsl:if>
<xsl:if test="string-length(value_caption) &gt; 49">
<span class="feldwert"><![CDATA[]]><xsl:value-of select="substring(value_caption,0,50)" /><![CDATA[]]>...</span>
</xsl:if>
<xsl:if test="sicht!=''">
<span><![CDATA[ (]]><xsl:value-of select="sicht" />
<xsl:if test="@stand!=''"><xsl:text> - Stand:</xsl:text><xsl:value-of select="@stand"/></xsl:if>
<xsl:text><![CDATA[)]]> </xsl:text></span>
</xsl:if>
;
</xsl:if>
</xsl:for-each>
User: <xsl:value-of select="/ergebnisse/user"/>&#160;
Stand: <xsl:value-of select="../stand" /></p>
<xsl:if test="../hinweis != ''">
<xsl:call-template name="newline_to_br">
<xsl:with-param name="string" select="../hinweis" />
</xsl:call-template>
</xsl:if>
</div>
</xsl:template>
<xsl:template name="viewer_kachel">
<xsl:param name="caption" />
<xsl:param name="ergebniselement_ordnr" />
<p class="title is-5"><xsl:value-of select="$caption" /></p>
<div id="{concat('chartDiv',$ergebniselement_ordnr)}">
Platzhalter
</div>
<xsl:call-template name="legende_viz" >
<xsl:with-param name="ordnr" select="$ergebniselement_ordnr" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

184
superx/xml/viz_html_chart_viewer.xsl

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:HtmlUtils="de.superx.util.HtmlUtils">
<xsl:import href="xsl_functions.xsl" />
<xsl:import href="resultset_html.xsl" />
<xsl:import href="interLinks_html.xsl" />
<xsl:import href="pageComponents_html.xsl" />
<xsl:import href="pageComponents_html_final.xsl" />
<xsl:import href="viz_html_chart.xsl" />
<xsl:import href="menue_html_dojo.xsl" />
<!--In diesem Stylesheet können Sie individuelle templates unterbringen,
die in ihrer Präzedenz das normale Stylesheet
pageComponents_html.xsl überragt. -->
<xsl:import href="pageComponents_html_final.xsl" />
<xsl:decimal-format name="German" grouping-separator="." NaN="" zero-digit ="0" decimal-separator="," />
<!-- wichtig für DOJO!-->
<xsl:output method="xml" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="DTD/xhtml1-strict.dtd" cdata-section-elements="script style" indent="yes" encoding="UTF-8"/>
<xsl:variable name="defaultRenderer" select="'d3js'" />
<xsl:variable name="availableRendererPlot" select="'false'" />
<xsl:variable name="availableRendererD3" select="'true'" />
<xsl:template match="/">
<xsl:call-template name="table"/>
</xsl:template>
<!-- start table main-->
<xsl:template name="table">
<html>
<xsl:choose>
<xsl:when test="/ergebnisse/@hisinone_active='true'">
<xsl:call-template name="head_hisinone" ><xsl:with-param name="title" select="concat('Ergebnis ',/ergebnisse/ergebnis[ position()=1]/maskenname)" /></xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="head_superx_viz" ><xsl:with-param name="title" select="concat('Ergebnis ',/ergebnisse/ergebnis[ position()=1]/maskenname)" /></xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="tableJavascript_viz"></xsl:call-template>
<!-- start Body-->
<body onload="document.getElementById('progressbar').style.display='none';initPage();"> <!-- tableonload definiert in pageComponents.pccustomize position table_post_javascript -->
<div id="progressbar" style="position:absolute; width:150px; height:150px; left:200px; top:200px; background:#AAAAAA">
<p>&#160;<b>Laden...</b><br/><img src="../images/progress_bar.gif"></img><br/></p></div>
<xsl:if test="/ergebnisse/@showNavigation='true'">
<xsl:for-each select="/ergebnisse/menue">
<xsl:call-template name="menuFrame" />
</xsl:for-each>
</xsl:if>
<div>
<xsl:if test="/ergebnisse/@showNavigation='true'">
<xsl:attribute name="class"><xsl:text>page-wrap</xsl:text></xsl:attribute>
<xsl:for-each select="/ergebnisse/menue">
<xsl:call-template name="topbar_menue" />
</xsl:for-each>
</xsl:if>
<div>
<xsl:if test="/ergebnisse/@showNavigation='true'">
<xsl:attribute name="id"><xsl:text>wrapper</xsl:text></xsl:attribute>
</xsl:if>
<xsl:call-template name="viz_canvas"/>
<xsl:call-template name="bottombar" />
<xsl:comment>customfooter</xsl:comment>
</div>
</div>
<xsl:call-template name="footer" />
</body>
<!-- end body -->
</html>
</xsl:template>
<!-- end main -->
<xsl:template name="importVizJavascriptLibs">
<script language="Javascript" type="text/javascript" src="../xml/js/viz/d3.min.js" />
<script language="Javascript" type="text/javascript" src="../xml/js/viz/plot.js" />
<script language="Javascript" type="text/javascript" src="../xml/js/viz/viz_functions.js" />
<script language="Javascript" type="module" src="../xml/js/viz/d3-sankey.js" />
<script language="Javascript" type="text/javascript">
<xsl:variable name="quote"><xsl:text>"</xsl:text></xsl:variable>
<xsl:text><![CDATA[
function initPage()
{
var myChartModelStr="";
var myDiv="";
]]></xsl:text>
<xsl:for-each select="ergebnisse">
<xsl:for-each select="ergebnis/ergebniselement">
<xsl:variable name="chart_id"><xsl:value-of select="../felder/feld[@varname='Grafik']/value" /></xsl:variable>
<xsl:variable name="ergebniselement_ordnr"><xsl:value-of select="@ordnr" /></xsl:variable>
<xsl:if test="$chart_id != ''">
<xsl:text><![CDATA[
myChartModelStr=']]></xsl:text>
<xsl:value-of select="translate(viz_charts/viz_chart[@tid=$chart_id]/@chartmodel,'§',$quote)" />
<xsl:text><![CDATA[';
myDiv="]]></xsl:text>
<xsl:value-of select="concat('chartDiv',$ergebniselement_ordnr)" />
<xsl:text><![CDATA[";
createViewer(myChartModelStr,myDiv);
]]></xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
<xsl:text><![CDATA[
}
function createViewer(myChartModelStr,chartDiv)
{
myChartModel=JSON.parse(myChartModelStr);
renderChart(chartDiv,myChartModel);
}
function toggleLegendeDisplay(legendeDiv)
{
var myDiv=document.getElementById(legendeDiv);
if(myDiv.style.display=="block")
myDiv.style.display="none";
else
myDiv.style.display="block";
}
]]></xsl:text>
</script>
</xsl:template>
<xsl:template name="viz_canvas">
<xsl:if test="/ergebnisse/@isMakro='true'">
<h1><xsl:value-of select="/ergebnisse/makro/name" /></h1>
</xsl:if>
<p></p>
<xsl:call-template name="buildVizMetadata" />
<!-- end Kopf-->
<!-- start Grafiken-->
<!-- Berechne den Umbruch der Spalten für die Kacheln
z.B. 6 Grafiken ergibt einen Umbruch nach der 3. Teiltabelle
Formel: ANZ / 2 kaufm. gerundet
-->
<xsl:variable name="ergebniselemente_anz">
<xsl:value-of select="count(/ergebnisse/ergebnis[felder/feld[@varname='Grafik']])"/>
</xsl:variable>
<xsl:variable name="ergebniselemente_umbruch">
<xsl:value-of select="round($ergebniselemente_anz div max(number(/ergebnisse/ergebnis/felder/feld[@varname='Spaltenanzahl']/value)))"/>
</xsl:variable>
<!--<p>plan: <xsl:value-of select="concat($ergebniselemente_anz,'-',/ergebnisse/ergebnis/felder/feld[@varname='Spaltenanzahl']/value,' Umbruch: ',$ergebniselemente_umbruch)"/>
</p>-->
<span class="separator">&#160;</span>
<!--Beginn Selektions-Card-->
<!--Beginn Berichtstitel, Pfad, Knopfleiste-->
<section class="hero-body has-background-light">
<div class="columns is-mobile is-left">
<xsl:text disable-output-escaping="true"><![CDATA[
<div class="column">
]]></xsl:text>
<xsl:for-each select="ergebnisse/ergebnis[felder/feld[@varname='Grafik']/value!='']/ergebniselement">
<xsl:variable name="ergebniselement_counter" select="position()" />
<xsl:variable name="chart_id"><xsl:value-of select="../felder/feld[@varname='Grafik']/value" /></xsl:variable>
<xsl:variable name="ergebniselement_ordnr"><xsl:value-of select="@ordnr" /></xsl:variable>
<!--<p><xsl:value-of select="concat('Zähler: ',$ergebniselement_counter)"/></p>-->
<xsl:call-template name="viewer_kachel">
<xsl:with-param name="caption" select="viz_charts/viz_chart[@tid=$chart_id]/@caption"/>
<xsl:with-param name="ergebniselement_ordnr" select="$ergebniselement_ordnr" />
</xsl:call-template>
<!-- neue Spalte wenn counter=umbruch -->
<xsl:if test="$ergebniselement_counter = $ergebniselemente_umbruch ">
<xsl:text disable-output-escaping="true"><![CDATA[</div>
<div class="column">
]]></xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text disable-output-escaping="true"><![CDATA[</div>]]></xsl:text> <!-- der letzten column -->
</div><!-- der columns -->
</section>
</xsl:template>
</xsl:stylesheet>
Loading…
Cancel
Save