Skip to content

Commit

Permalink
fix(ledge-pipeline): ledge-pipeline default configuration
Browse files Browse the repository at this point in the history
re #58
  • Loading branch information
klxq-ling authored and phodal committed May 4, 2020
1 parent 0c6ef28 commit 0ca5e91
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Job,
PipelineConfig,
PolygonPoints,
defaultPipelineConfig,
} from './ledge-pipeline.model';

@Component({
Expand All @@ -20,24 +21,12 @@ export class LedgePipelineComponent implements AfterViewInit {
data: any[] = [];

@Input()
config: PipelineConfig = {
connectionStrokeWidth: 4,
stateStrokeWidth: 4,
stateRadius: 16,
stageSpace: 60,
stageLabelHeight: 30,
stageLabelSize: '16px',
jobHeight: 60,
jobLabelSize: '12px',
startNodeRadius: 12,
startNodeSpace: 40,
endNodeRadius: 12,
endNodeSpace: 40,
};
config: PipelineConfig;

@ViewChild('pipeline', { static: false }) pipeline: ElementRef;

ngAfterViewInit(): void {
this.config = { ...defaultPipelineConfig, ...this.config };
const stages = this.buildStages();
const svg = d3.select(this.pipeline.nativeElement)
.append('svg')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,18 @@ export enum PolygonPoints {
checkMark = '-2.00 2.80 -4.80 0.00 -5.73 0.933 -2.00 4.67 6.00 -3.33 5.07 -4.27',
crossMark = '4.67 -3.73 3.73 -4.67 0 -0.94 -3.73 -4.67 -4.67 -3.73 -0.94 0 -4.67 3.73 -3.73 4.67 0 0.94 3.73 4.67 4.67 3.73 0.94 0',
}

export const defaultPipelineConfig = {
connectionStrokeWidth: 4,
stateStrokeWidth: 4,
stateRadius: 16,
stageSpace: 60,
stageLabelHeight: 30,
stageLabelSize: '16px',
jobHeight: 60,
jobLabelSize: '12px',
startNodeRadius: 12,
startNodeSpace: 40,
endNodeRadius: 12,
endNodeSpace: 40,
};

0 comments on commit 0ca5e91

Please sign in to comment.