Visualisierungsmodul für SuperX
http://www.superx-projekt.de/doku/viz_modul/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
304 lines
11 KiB
304 lines
11 KiB
<?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="viz_html_chart.xsl" /> |
|
<xsl:import href="viz_components.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> <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" /> |
|
<xsl:call-template name="modalCards" /> |
|
</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); |
|
myDiv="]]></xsl:text> |
|
<xsl:value-of select="concat('modalCardImage',$ergebniselement_ordnr)" /> |
|
<xsl:text><![CDATA["; |
|
createViewer(myChartModelStr,myDiv); |
|
myDiv="]]></xsl:text> |
|
<xsl:value-of select="concat('modalCardDetailImage',$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="spalten_anz"> |
|
<xsl:value-of select="max(number(/ergebnisse/ergebnis/felder/feld[@varname='Spaltenanzahl']/value))"/> |
|
</xsl:variable> |
|
<xsl:variable name="colwidth"> |
|
<xsl:value-of select="12 div $spalten_anz"/> |
|
</xsl:variable> |
|
|
|
<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="/ergebnisse/ergebnis/felder/feld[@varname='Spaltenanzahl']/value"/> |
|
</p>--> |
|
<span class="separator"> </span> |
|
<!--Beginn Selektions-Card--> |
|
<!--Beginn Berichtstitel, Pfad, Knopfleiste--> |
|
<section class="hero-body has-background-light"> |
|
<section class="container"> <!--Beginn Kartenreihe --> |
|
<div class="columns features is-mobile is-left"> <!--Beginn columns Kartenreihe --> |
|
|
|
<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>--> |
|
<div> |
|
<xsl:attribute name="class"><xsl:text>column is-</xsl:text><xsl:value-of select="$colwidth"/></xsl:attribute> |
|
<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> |
|
<!--<p><xsl:value-of select="concat($spalten_anz,'-',$ergebniselement_counter,':',$ergebniselement_counter mod $spalten_anz)"/></p>--> |
|
</div> |
|
<!-- neue Zeile wenn counter mod Spaltenanz. =0 --> |
|
|
|
<xsl:if test="$ergebniselement_counter >= $spalten_anz and ($ergebniselement_counter mod $spalten_anz) =0"> |
|
<xsl:text disable-output-escaping="yes"><![CDATA[ |
|
</div> |
|
</section> |
|
<section class="container"> |
|
<div class="columns features is-mobile is-left"> |
|
]]></xsl:text> |
|
</xsl:if> |
|
</xsl:for-each> |
|
</div><!-- der columns --> |
|
</section><!-- der letzten Kartenreihe --> |
|
</section><!-- des Portals --> |
|
</xsl:template> |
|
<xsl:template name="modalCards" > |
|
<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 != ''"> |
|
<div class="modal modal-fx-3dSlit" id="{concat('modalCard',$ergebniselement_ordnr)}"> |
|
<div class="modal-background"></div> |
|
<div class="modal-content is-huge is-image"> |
|
<!-- content --> |
|
|
|
<div class="modal-content"> |
|
<div class="box" style="text-align:right"> |
|
<a href="{concat('javascript:closeModalImage(',$ergebniselement_ordnr,');')}"> |
|
<span class="button is-black is-outlined"> X </span> |
|
</a> |
|
</div> |
|
<div class="box"> |
|
<div id="{concat('modalCardImage',$ergebniselement_ordnr)}"> |
|
Picture placeholder |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
</div> |
|
|
|
<div class="modal modal-fx-3dSlit" id="{concat('modalCardDetail',$ergebniselement_ordnr)}"> |
|
<div class="modal-background"></div> |
|
<div class="modal-content is-tiny"> |
|
<div class="box" style="text-align:right"> |
|
<h4><xsl:value-of select="viz_charts/viz_chart[@tid=$chart_id]/@caption"/></h4> |
|
<a href="{concat('javascript:closeModalCardDetail(',$ergebniselement_ordnr,');')}"> |
|
<span class="button is-black is-outlined"> X </span> |
|
</a> |
|
</div> |
|
<!-- content --> |
|
<div class="card"> |
|
<div class="card-image"> |
|
<div id="{concat('modalCardDetailImage',$ergebniselement_ordnr)}"> |
|
Picture placeholder |
|
</div> |
|
</div> |
|
|
|
<div class="card-content"> |
|
<div class="media"> |
|
<div class="media-content"> |
|
<p><xsl:value-of select="viz_charts/viz_chart[@tid=$chart_id]/@description"/></p> |
|
<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) > 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>:  |
|
<xsl:if test="string-length(value_caption) < 50"> |
|
<span class="feldwert"><xsl:value-of select="value_caption" /><![CDATA[]]></span> |
|
</xsl:if> |
|
<xsl:if test="string-length(value_caption) > 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"/>  |
|
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> |
|
<p align="right"><a href="{concat('javascript:closeModalCardDetail(',$ergebniselement_ordnr,');')}"> |
|
<span class="button is-black is-outlined"> X </span> |
|
</a></p> |
|
</div> |
|
|
|
</div> |
|
</div> |
|
</div> |
|
|
|
</div> |
|
</xsl:if> |
|
</xsl:for-each> |
|
</xsl:for-each> |
|
</xsl:template> |
|
</xsl:stylesheet>
|
|
|