Skip to content

Commit

Permalink
Branch actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Googler authored and Copybara-Service committed Apr 30, 2024
1 parent 5c42084 commit ee76e18
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/app/data_types_internal.ts
Expand Up @@ -531,7 +531,7 @@ export type StatusPalette = {
};

/** Marker style to use at the ends of edges in the DAG, `circle` by default */
export type MarkerStyle = 'circle'|'arrow';
export type MarkerStyle = 'circle'|'arrow'|'hidden';

/** The layout of Edge drawn on the DAG, this is `dagre` by default */
export type EdgeStyle = 'dagre'|'snapped'; // dagre by default.
Expand All @@ -550,6 +550,7 @@ export interface DagTheme {
edgeColor: string;
edgeStyle: EdgeStyle;
edgeToMarkerStyle: MarkerStyle;
edgeFromMarkerStyle: MarkerStyle;
edgeWidth: number;
background: {
dots: {
Expand Down Expand Up @@ -670,6 +671,7 @@ export const DEFAULT_THEME: DagTheme = {
edgeColor: baseColors['blue'],
edgeStyle: 'dagre',
edgeToMarkerStyle: 'circle',
edgeFromMarkerStyle: 'circle',
edgeWidth: 1,
background: {
dots: {
Expand Down
4 changes: 3 additions & 1 deletion src/app/directed_acyclic_graph.ts
Expand Up @@ -27,7 +27,7 @@ import {takeUntil, throttleTime} from 'rxjs/operators';
import {ShortcutService} from './a11y/shortcut.service';
import {DagStateService} from './dag-state.service';
import {STATE_SERVICE_PROVIDER} from './dag-state.service.provider';
import {baseColors, BLUE_THEME, clampVal, CLASSIC_THEME, createDAGFeatures, createDefaultZoomConfig, createNewSizeConfig, type DagTheme, DEFAULT_LAYOUT_OPTIONS, DEFAULT_THEME, defaultFeatures, defaultZoomConfig, type FeatureToggleOptions, generateTheme, getMargin, isPoint, type LayoutOptions, type Logger, type MinimapPosition, nanSafePt, NODE_HEIGHT, NODE_WIDTH, NodeState, OrientationMarginConfig, RankAlignment, RankDirection, RankerAlgorithim, SCROLL_STEP_PER_DELTA, SizeConfig, SVG_ELEMENT_SIZE, type ZoomConfig} from './data_types_internal';
import {baseColors, BLUE_THEME, clampVal, CLASSIC_THEME, createDAGFeatures, createDefaultZoomConfig, createNewSizeConfig, type DagTheme, DEFAULT_LAYOUT_OPTIONS, DEFAULT_THEME, defaultFeatures, defaultZoomConfig, EdgeStyle, type FeatureToggleOptions, generateTheme, getMargin, isPoint, type LayoutOptions, type Logger, MarkerStyle, type MinimapPosition, nanSafePt, NODE_HEIGHT, NODE_WIDTH, NodeState, OrientationMarginConfig, RankAlignment, RankDirection, RankerAlgorithim, SCROLL_STEP_PER_DELTA, SizeConfig, SVG_ELEMENT_SIZE, type ZoomConfig} from './data_types_internal';
import {DagRaw, DagRawModule, EnhancedDagGroup, GraphDims} from './directed_acyclic_graph_raw';
import {Translations, TranslationsService} from './i18n';
import {DagLogger} from './logger/dag_logger';
Expand All @@ -53,11 +53,13 @@ export {
DEFAULT_THEME,
defaultFeatures,
defaultZoomConfig,
type EdgeStyle,
type FeatureToggleOptions,
generateTheme,
getMargin,
type GroupIterationRecord,
type LayoutOptions as DagreOptions,
type MarkerStyle,
type MinimapPosition,
NODE_HEIGHT,
NODE_WIDTH,
Expand Down
7 changes: 5 additions & 2 deletions src/app/directed_acyclic_graph_raw.ng.html
Expand Up @@ -70,7 +70,9 @@
<svg class="marker canvas" aria-hidden="true">
<ng-container *ngFor="let e of edges; trackBy: edgeTrack">
<g *ngIf="isDagreInit(e)" class="marker-group fade-in">
<g [ngClass]="edgeMarkerClassesFor(e, 'from')">
<g
*ngIf="(e.fromMarkerStyle || theme.edgeFromMarkerStyle) !== 'hidden'"
[ngClass]="edgeMarkerClassesFor(e, 'from')">
<circle
r="4"
class="outer-circle"
Expand All @@ -81,7 +83,8 @@
<circle r="3" class="inner-circle" [attr.cx]="e.points?.[0]?.x" [attr.cy]="e.points?.[0]?.y" />
</g>
<g
*ngIf="(e.toMarkerStyle || theme.edgeToMarkerStyle) === 'circle'"
*ngIf="(e.toMarkerStyle || theme.edgeToMarkerStyle) === 'circle' &&
(e.toMarkerStyle || theme.edgeToMarkerStyle) !== 'hidden'"
[ngClass]="edgeMarkerClassesFor(e, 'to')"
>
<circle
Expand Down
1 change: 1 addition & 0 deletions src/app/node_spec.ts
Expand Up @@ -395,6 +395,7 @@ export interface DagEdge {
points?: Point[];
color?: string;
toMarkerStyle?: MarkerStyle; // circle by default.
fromMarkerStyle?: MarkerStyle; // circle by default.
/**
* Multiplier for how thick an edge should be relative to the base thickness.
* The base value this is multiplied to is stored in Theme.edgeWidth = 1
Expand Down

0 comments on commit ee76e18

Please sign in to comment.