-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Define the options that will be used to configure the Renderer #2659
Comments
I don't understand why there is a "sub" attribute |
This is a good idea to have a way to define the styles independent of the underlying techno (mxGraph) .
Apart from that, I agree with the the comment above, the "defaults" property does not seem useful. |
if fill, font and stroke are groups with subproperties in general properties, I feel it should be the same in bpmn and overlays. |
Thank you all for your comments. 😍 We will take them into account. The currently named @abirembaut yes we must be consistent across properties: flat properties or structured objects (this is what we use in existing API). |
Some propositionsGlobalOptionsinterface GlobalOptions {
// existing properties...
renderer?: RendererOptions;
} RendererOptionsinterface RendererOptions {
default?: DefaultOptions;
bpmnIgnore?: BpmnIgnoreOptions;
} DefaultOptionsinterface DefaultOptions {
general?: GeneralOptions;
bpmn?: BpmnOptions;
overlay?: OverlayOptions;
} GeneralOptionsinterface GeneralOptions {
margin?: number; // DEFAULT_MARGIN = 0
fill?: Fill;
font?: Font;
stroke?: Stroke;
} BpmnOptionsinterface BpmnOptions {
activity?: ActivityOptions;
group?: {
fill?: Pick<Fill, 'color'>; // GROUP_FILL_COLOR = 'none'
};
lane?: {
label?: LabelOptions; // LANE_LABEL_FILL_COLOR = 'none'; LANE_LABEL_SIZE = 30
};
pool?: {
label?: LabelOptions; // POOL_LABEL_FILL_COLOR = 'none'; POOL_LABEL_SIZE = 30
};
subProcess?: SubProcessOptions;
textAnnotation?: TextAnnotationOptions;
messageFlow?: MessageFlowOptions;
sequenceFlow?: SequenceFlowOptions;
shape?: {
arcSize?: number; // SHAPE_ARC_SIZE = 20
strokeWidth?: {
thick?: number; // STROKE_WIDTH_THICK = 5
thin?: number; // STROKE_WIDTH_THIN = 2
};
};
edge?: { // Or flow?: {
arcSize?: number; // currently not configurable
};
} BpmnIgnoreOptionsinterface BpmnIgnoreOptions {
activityLabelBounds?: boolean; // For #2469, default: false
colors?: boolean; // For #2614, default: false
labelStyles?: boolean; // For #2468, default: false
} ActivityOptionsinterface ActivityOptions {
margin?: {
bottom?: number; // SHAPE_ACTIVITY_BOTTOM_MARGIN = 7
top?: number; // SHAPE_ACTIVITY_TOP_MARGIN = 7
left?: number; // SHAPE_ACTIVITY_LEFT_MARGIN = 7
fromCenter?: number; // SHAPE_ACTIVITY_FROM_CENTER_MARGIN = 7
};
markerIcon?: {
margin?: number; // SHAPE_ACTIVITY_MARKER_ICON_MARGIN = 5
size?: number; // SHAPE_ACTIVITY_MARKER_ICON_SIZE = 20
};
} SubProcessOptionsinterface SubProcessOptions {
transaction?: {
innerRectangle?: {
arcSize?: number; // SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE = 6
offset?: number; // SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET = 4
};
};
} TextAnnotationOptionsinterface TextAnnotationOptions {
borderLength?: number; // TEXT_ANNOTATION_BORDER_LENGTH = 10
fill?: Pick<Fill, 'color'>; // TEXT_ANNOTATION_FILL_COLOR = 'none'
} MessageFlowOptionsinterface MessageFlowOptions {
fillColor?: {
endMarker?: string; // MESSAGE_FLOW_MARKER_END_FILL_COLOR = 'White'
startMarker?: string; // MESSAGE_FLOW_MARKER_START_FILL_COLOR = 'White'
};
} SequenceFlowOptionsinterface SequenceFlowOptions {
fillColor?: {
conditionalMarker?: string; // SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR = 'White'
};
} LabelOptionsinterface LabelOptions {
fill?: Pick<Fill, 'color'>;
size?: number;
} OverlayOptionsinterface OverlayOptions {
fill?: Fill; // DEFAULT_OVERLAY_FILL_COLOR = DEFAULT_FILL_COLOR; DEFAULT_OVERLAY_FILL_OPACITY = 100
font?: Pick<Font, 'color' | 'size'>; // DEFAULT_OVERLAY_FONT_COLOR = DEFAULT_FONT_COLOR; DEFAULT_OVERLAY_FONT_SIZE = DEFAULT_FONT_SIZE
stroke?: Pick<Stroke, 'color' | 'width'>; // DEFAULT_OVERLAY_STROKE_COLOR = DEFAULT_STROKE_COLOR; DEFAULT_OVERLAY_STROKE_WIDTH = 1
} |
@csouchet I have seen what you propose to split the type/interface into multiple type/interface. For the time being, we won't be reusing them. So, for simplicity's sake, I'm proposing a single type/interface. This will produce a better result in the API's HTML documentation and make things easier to understand. While the usage of Pick, Font, Stroke, ... types may be finally implemented to remove duplication, this makes things harder to understand here. Remember that we cannot reuse the existing types of the Overlay and the "Update Style" APIs (see #2457) We should also review if we use flat properties vs object as this makes the configuration more verbose. I am not convinced about the need for a |
A POC of the implementation from my last proposition: #2761 Maybe, we should consider to not implement the updating of our default internal value at the initialization of the library, and focus on a new API for the theme. |
Decision taken with @csouchet on
|
@tbouffard The name of the For the overlays, I propose simply |
@csouchet thanks for your feedback. |
All decisions have been taken and the final proposal has been documented. |
We have several issues that requires to pass new options to the renderer.
To have something consistent, I suggest we review all requirements to propose a consistent Options definition.
Topics involved:
[FEAT] Review Black Box Pool Rendering #718: finally not plannedWay of working
Final proposal
Initial proposal
#718: I suggest to NOT make it an option. Decide whether to implement it or keep it as it is today. We could introduce the option later if someone request it and motivate their needs. Today I don't see the benefits of such an option.
The most urgent decision must be taken to finalize the implementation of #2614
Guidelines
ignoreBpmn
Questions
defaults
propertyWe may introduce a
bpmnIgnores
that holds all "ignored" properties. This seems overkill for 3 propertiespast proposed names for #718
past proposed names for #2614
Le
The text was updated successfully, but these errors were encountered: