Merge branch 'alanaV11' into pebr/neo-style

This commit is contained in:
Per Brolin
2024-06-18 15:05:46 +02:00
11 changed files with 46 additions and 21 deletions

View File

@@ -174,7 +174,7 @@ g.stateGroup line {
.state-shadow-neo { .state-shadow-neo {
filter: drop-shadow( 1px 2px 2px rgba(185,185,185,1.0) ); filter: ${options.dropShadow} );
} }

View File

@@ -63,7 +63,30 @@ export const render = async (data4Layout: any, svg: any, element: any, positions
gradient gradient
.append('svg:stop') .append('svg:stop')
.attr('offset', '100%') .attr('offset', '10%')
.attr('stop-color', gradientStop)
.attr('stop-opacity', 1);
gradient
.append('svg:stop')
.attr('offset', '30%')
.attr('stop-color', gradientStart)
.attr('stop-opacity', 1);
gradient
.append('svg:stop')
.attr('offset', '35%')
.attr('stop-color', gradientStop)
.attr('stop-opacity', 1);
gradient
.append('svg:stop')
.attr('offset', '60%')
.attr('stop-color', gradientStart)
.attr('stop-opacity', 1);
gradient
.append('svg:stop')
.attr('offset', '80%')
.attr('stop-color', gradientStop) .attr('stop-color', gradientStop)
.attr('stop-opacity', 1); .attr('stop-opacity', 1);
} }

View File

@@ -17,7 +17,11 @@ const rect = (parent, node) => {
const { clusterBkg, clusterBorder } = themeVariables; const { clusterBkg, clusterBorder } = themeVariables;
// Add outer g element // Add outer g element
const shapeSvg = parent.insert('g').attr('class', 'cluster').attr('id', node.id); const shapeSvg = parent
.insert('g')
.attr('class', 'cluster')
.attr('id', node.id)
.attr('data-look', node.look);
const useHtmlLabels = evaluate(siteConfig.flowchart.htmlLabels); const useHtmlLabels = evaluate(siteConfig.flowchart.htmlLabels);

View File

@@ -14,6 +14,7 @@ const getStyles = (
errorBkgColor: string; errorBkgColor: string;
errorTextColor: string; errorTextColor: string;
lineColor: string; lineColor: string;
useGradient: boolean;
} & FlowChartStyleOptions } & FlowChartStyleOptions
) => { ) => {
let diagramStyles = ''; let diagramStyles = '';
@@ -73,33 +74,24 @@ const getStyles = (
stroke: ${options.nodeBorder}; stroke: ${options.nodeBorder};
} }
[data-look="neo"].node rect, [data-look="neo"].node polygon { [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
//stroke: none;
stroke: ${options.useGradient ? 'url(#gradient)' : options.nodeBorder}; stroke: ${options.useGradient ? 'url(#gradient)' : options.nodeBorder};
filter: drop-shadow( 1px 2px 2px rgba(185,185,185,1.0) ); filter: ${options.dropShadow} );
// rx: 3;
// ry: 3;
} }
[data-look="neo"].node rect, [data-look="neo"].node circle, [data-look="neo"].node polygon { [data-look="neo"].node rect, [data-look="neo"].node circle, [data-look="neo"].node polygon {
//stroke: $(options.nodeBorder);
stroke: ${options.useGradient ? 'url(#gradient)' : options.nodeBorder}; stroke: ${options.useGradient ? 'url(#gradient)' : options.nodeBorder};
filter: drop-shadow( 1px 2px 2px rgba(185,185,185,1.0) ); filter: ${options.dropShadow} );
// rx: 3;
// ry: 3;
} }
[data-look="neo"].node circle{ [data-look="neo"].node circle{
stroke: $(options.nodeBorder); stroke: $(options.nodeBorder);
stroke: ${options.useGradient ? 'url(#gradient)' : options.nodeBorder}; stroke: ${options.useGradient ? 'url(#gradient)' : options.nodeBorder};
filter: drop-shadow( 1px 2px 2px rgba(185,185,185,1.0) );
//fill: #000000; filter: ${options.dropShadow} );
// rx: 3;
// ry: 3;
} }
[data-look="neo"].node circle .state-start{ [data-look="neo"].node circle .state-start{
fill: #000000; fill: #000000;
} }

View File

@@ -26,6 +26,7 @@ class Theme {
this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
this.fontSize = '16px'; this.fontSize = '16px';
this.useGradient = true; this.useGradient = true;
this.dropShadow = 'drop-shadow( 1px 2px 2px rgba(185,185,185,1)';
} }
updateColors() { updateColors() {
// The || is to make sure that if the variable has been defined by a user override that value is to be used // The || is to make sure that if the variable has been defined by a user override that value is to be used

View File

@@ -93,6 +93,7 @@ class Theme {
this.useGradient = true; this.useGradient = true;
this.gradientStart = this.primaryBorderColor; this.gradientStart = this.primaryBorderColor;
this.gradientStop = this.secondaryBorderColor; this.gradientStop = this.secondaryBorderColor;
this.dropShadow = 'drop-shadow( 1px 2px 2px rgba(185,185,185,1))';
} }
updateColors() { updateColors() {
this.secondBkg = lighten(this.mainBkg, 16); this.secondBkg = lighten(this.mainBkg, 16);

View File

@@ -120,6 +120,7 @@ class Theme {
this.useGradient = true; this.useGradient = true;
this.gradientStart = this.primaryBorderColor; this.gradientStart = this.primaryBorderColor;
this.gradientStop = this.secondaryBorderColor; this.gradientStop = this.secondaryBorderColor;
this.dropShadow = 'drop-shadow( 1px 2px 2px rgba(185,185,185,1))';
this.updateColors(); this.updateColors();
} }
updateColors() { updateColors() {

View File

@@ -96,6 +96,7 @@ class Theme {
this.useGradient = true; this.useGradient = true;
this.gradientStart = this.primaryBorderColor; this.gradientStart = this.primaryBorderColor;
this.gradientStop = this.secondaryBorderColor; this.gradientStop = this.secondaryBorderColor;
this.dropShadow = 'drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))';
} }
updateColors() { updateColors() {
/* Sequence Diagram variables */ /* Sequence Diagram variables */
@@ -342,8 +343,6 @@ class Theme {
this.attributeBackgroundColorEven = this.attributeBackgroundColorEven =
this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven; this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
/* -------------------------------------------------- */ /* -------------------------------------------------- */
this.useGradient = true;
} }
calculate(overrides) { calculate(overrides) {
if (typeof overrides !== 'object') { if (typeof overrides !== 'object') {

View File

@@ -23,7 +23,7 @@ class Theme {
this.secondaryTextColor = invert(this.secondaryColor); this.secondaryTextColor = invert(this.secondaryColor);
this.tertiaryTextColor = invert(this.tertiaryColor); this.tertiaryTextColor = invert(this.tertiaryColor);
this.mainBkg = '#1f2020'; this.mainBkg = '#2a2020';
this.secondBkg = 'calculated'; this.secondBkg = 'calculated';
this.mainContrastColor = 'lightgrey'; this.mainContrastColor = 'lightgrey';
this.darkTextColor = lighten(invert('#323D47'), 10); this.darkTextColor = lighten(invert('#323D47'), 10);
@@ -52,6 +52,7 @@ class Theme {
this.useGradient = true; this.useGradient = true;
this.gradientStart = '#eb0042'; this.gradientStart = '#eb0042';
this.gradientStop = '#0042eb'; this.gradientStop = '#0042eb';
this.dropShadow = 'drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))';
} }
updateColors() { updateColors() {
// The || is to make sure that if the variable has been defined by a user override that value is to be used // The || is to make sure that if the variable has been defined by a user override that value is to be used

View File

@@ -33,6 +33,8 @@ class Theme {
this.useGradient = true; this.useGradient = true;
this.gradientStart = '#eb0042'; this.gradientStart = '#eb0042';
this.gradientStop = '#0042eb'; this.gradientStop = '#0042eb';
this.dropShadow = 'drop-shadow( 1px 2px 2px rgba(185,185,185,1))';
this.tertiaryColor = '#ffffff';
} }
updateColors() { updateColors() {
// The || is to make sure that if the variable has been defined by a user override that value is to be used // The || is to make sure that if the variable has been defined by a user override that value is to be used

View File

@@ -107,6 +107,7 @@ class Theme {
this.useGradient = true; this.useGradient = true;
this.gradientStart = this.primaryBorderColor; this.gradientStart = this.primaryBorderColor;
this.gradientStop = this.secondaryBorderColor; this.gradientStop = this.secondaryBorderColor;
this.dropShadow = 'drop-shadow( 1px 2px 2px rgba(185,185,185,1))';
} }
updateColors() { updateColors() {
this.secondBkg = lighten(this.contrast, 55); this.secondBkg = lighten(this.contrast, 55);