@ -1223,8 +1223,9 @@ function renderGeneralChartPropertiesForm(formDiv,myCommonChartProperties,render
{
{
var newcommonChartPropertyGroup = new commonChartPropertyGroup ( myCommonChartProperties [ k ] . groupCaption , groupUniquename , "" ) ;
var newcommonChartPropertyGroup = new commonChartPropertyGroup ( myCommonChartProperties [ k ] . groupCaption , groupUniquename , "" ) ;
commonChartPropertyGroups . push ( newcommonChartPropertyGroup ) ;
commonChartPropertyGroups . push ( newcommonChartPropertyGroup ) ;
previousGroup = groupUniquename ;
}
}
previousGroup = groupUniquename ;
}
}
const columnDiv = document . createElement ( "div" ) ;
const columnDiv = document . createElement ( "div" ) ;
for ( var i = 0 ; i < commonChartPropertyGroups . length ; i ++ )
for ( var i = 0 ; i < commonChartPropertyGroups . length ; i ++ )
@ -2529,12 +2530,13 @@ if(numberOfChildNodes>0)
{
{
switch ( renderer ) {
switch ( renderer ) {
case "plot" :
case "plot" :
var myFigure = myChartDiv . childNodes [ 0 ] ;
for ( var i = 0 ; i < numberOfChildNodes ; i ++ )
if ( myFigure . childNodes . length > 0 )
{
{
var mySvg = myFigure . childNodes [ 0 ] ;
var myNode = myChartDiv . childNodes [ i ] ;
svg _xml = ( new XMLSerializer ) . serializeToString ( mySvg ) ;
var mySvg = myNode ;
}
// Extract the data as SVG text string
svg _xml += ( new XMLSerializer ) . serializeToString ( mySvg ) ;
}
break ;
break ;
case "d3js" :
case "d3js" :
for ( var i = 0 ; i < numberOfChildNodes ; i ++ )
for ( var i = 0 ; i < numberOfChildNodes ; i ++ )
@ -2542,7 +2544,7 @@ if(numberOfChildNodes>0)
var myNode = myChartDiv . childNodes [ i ] ;
var myNode = myChartDiv . childNodes [ i ] ;
if ( myNode . nodeName == "svg" )
if ( myNode . nodeName == "svg" )
{
{
var mySvg = myNode ; //document.getElementById("chartSVG");
var mySvg = myNode ;
// Extract the data as SVG text string
// Extract the data as SVG text string
svg _xml = ( new XMLSerializer ) . serializeToString ( mySvg ) ;
svg _xml = ( new XMLSerializer ) . serializeToString ( mySvg ) ;
}
}
@ -2576,6 +2578,7 @@ else
}
}
function showChartModelCode ( )
function showChartModelCode ( )
{
{
var mySrcDiv = document . getElementById ( "chartModelsrc" ) ;
var mySrcDiv = document . getElementById ( "chartModelsrc" ) ;
@ -2781,7 +2784,9 @@ for (let i = 1; i < 4; i++) {
function makeSankeyD3 ( myCommonChartProperties , mySvg , data , metaData , chartElem )
function makeSankeyD3 ( myCommonChartProperties , mySvg , data , metaData , chartElem )
{
{
// load the data
// load the data
var captionEmptyTarget = "Leer" ;
var captionEmptyTarget = getCommonChartPropertyFromModel ( myCommonChartProperties , "null_value_mask" ) ;
if ( captionEmptyTarget == "" )
captionEmptyTarget = "Leer" ;
var sNodes = getSankeyNodes ( data , captionEmptyTarget ) ; //graph.nodes;
var sNodes = getSankeyNodes ( data , captionEmptyTarget ) ; //graph.nodes;
var sLinks = getSankeyLinks ( sNodes , data ) ; //graph.links;
var sLinks = getSankeyLinks ( sNodes , data ) ; //graph.links;
renderSankey ( myCommonChartProperties , mySvg , sNodes , sLinks ) ;
renderSankey ( myCommonChartProperties , mySvg , sNodes , sLinks ) ;
@ -2902,7 +2907,15 @@ var margin = { top: 10, right: 10, bottom: 10, left: 10 },
var formatNumber = d3 . format ( ",.0f" ) , // zero decimal places
var formatNumber = d3 . format ( ",.0f" ) , // zero decimal places
format = function ( d ) { return formatNumber ( d ) ; } ,
format = function ( d ) { return formatNumber ( d ) ; } ,
color = d3 . scaleOrdinal ( ) . range ( [ "#002060ff" , "#164490ff" , "#4d75bcff" , "#98b3e6ff" , "#d5e2feff" , "#008cb0ff" ] ) ;
color = d3 . scaleOrdinal ( ) . range ( [ "#002060ff" , "#164490ff" , "#4d75bcff" , "#98b3e6ff" , "#d5e2feff" , "#008cb0ff" ] ) ;
var textColor = getCommonChartPropertyFromModel ( myCommonChartProperties , "color" ) ;
if ( textColor == "" )
textColor = "#3f3f3f" ;
var fontSize = getCommonChartPropertyFromModel ( myCommonChartProperties , "fontSize" ) ;
if ( fontSize == "" )
fontSize = "12pt" ;
var fontFamily = getCommonChartPropertyFromModel ( myCommonChartProperties , "fontFamily" ) ;
if ( fontFamily == "" )
fontFamily = "sans-serif" ;
// append the svg object to the body of the page
// append the svg object to the body of the page
/ * c o n s t s a n k e y D i v = s v g . s e l e c t A l l ( " g " )
/ * c o n s t s a n k e y D i v = s v g . s e l e c t A l l ( " g " )
. attr ( "transform" ,
. attr ( "transform" ,
@ -2955,7 +2968,7 @@ var graph=sankey(data);
var col = "rgb(" + r + "," + g + "," + b + ")" ;
var col = "rgb(" + r + "," + g + "," + b + ")" ;
return d . color = col ;
return d . color = col ;
} )
} )
/*.style("fill", d3.schemaPastel2)*/
@ -2985,15 +2998,43 @@ var graph=sankey(data);
// add in the title for the nodes
// add in the title for the nodes
node . append ( "text" )
node . append ( "text" )
. style ( "fill" , "#3f3f3f" )
. style ( "fill" , textColor )
. attr ( "x" , function ( d ) { return d . x0 - 6 ; } )
. attr ( "x" , function ( d ) { return d . x0 - 6 ; } )
. attr ( "y" , function ( d ) { return ( d . y1 + d . y0 ) / 2 ; } )
. attr ( "y" , function ( d ) { return ( d . y1 + d . y0 ) / 2 ; } )
. attr ( "dy" , "0.35em" )
. attr ( "dy" , "0.35em" )
. attr ( "font-size" , fontSize )
. attr ( "font-family" , fontFamily )
. attr ( "text-anchor" , "end" )
. attr ( "text-anchor" , "end" )
. text ( function ( d ) { return d . name ; } )
. text ( function ( d ) { return d . name ; } )
. filter ( function ( d ) { return d . x0 < width / 2 ; } )
. filter ( function ( d ) { return d . x0 < width / 2 ; } )
. attr ( "x" , function ( d ) { return d . x1 + 6 ; } )
. attr ( "x" , function ( d ) { return d . x1 + 6 ; } )
. attr ( "text-anchor" , "start" )
. attr ( "text-anchor" , "start" )
;
;
// add in the title for the nodes
/ * n o d e . a p p e n d ( " t e x t " )
. style ( "fill" , textColor )
. attr ( "x" , function ( d ) { return d . x0 - 6 ; } )
. attr ( "y" , function ( d ) { return ( d . y1 + d . y0 ) / 2 ; } )
. attr ( "dy" , "0.35em" )
. attr ( "text-anchor" , "end" )
. text ( function ( d ) { return d . name ; } )
. filter ( function ( d ) { return d . x0 < width / 2 ; } )
. attr ( "x" , function ( d ) { return d . x1 + 6 ; } )
. attr ( "text-anchor" , "start" )
; * /
// add in the value labels for the nodes
node . append ( "text" )
. style ( "fill" , textColor )
. attr ( "x" , function ( d ) { return d . x0 + 20 ; } ) //rechte Seite
. attr ( "y" , function ( d ) { return ( d . y1 + d . y0 ) / 2 ; } )
. attr ( "dy" , "0.35em" )
. attr ( "font-size" , fontSize )
. attr ( "font-family" , fontFamily )
. attr ( "text-anchor" , "start" )
. text ( function ( d ) { return d . value ; } )
. filter ( function ( d ) { return d . x0 < width / 2 ; } )
. attr ( "x" , function ( d ) { return d . x1 - 40 ; } ) //linke Seite
. attr ( "text-anchor" , "start" )
;
}
}