Skip to content
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: allow to style BPMN Elements #247

Merged
merged 10 commits into from
Sep 18, 2023
Merged

Conversation

csouchet
Copy link
Member

@csouchet csouchet commented Sep 12, 2023

This pull request includes changes to several files in the inst/htmlwidgets and R directories. Here is a description of the changes made in some files:

  1. R/funs.R:

    • Added a new function create_element_style which creates the correct style structure for BPMN elements.
    • Added a new function create_edge_style which creates the correct style structure for BPMN edges.
    • Added a new function create_shape_style to create the correct style structure for BPMN shapes.
    • Added a new `create_gradient_fill' function to create a gradient fill style for BPMN shapes.
    • Modified the create_stroke, create_font and create_fill functions to accept additional style properties.
    • Updated the build_bpmnContent function to accept a bpmnElementStyles parameter, which is a list of existing elements with their style to apply.
  2. R/bpmnVisualizationR.R:

    • Updated the display function to accept a bpmnElementStyles parameter which allows to specify styles for BPMN elements.
    • An example of how to use bpmnElementStyles to define styles for BPMN elements has been added to the function documentation.

To build the documentation

Closes #13

@csouchet csouchet added the enhancement New feature or request label Sep 12, 2023
@github-actions
Copy link

github-actions bot commented Sep 12, 2023

♻️ PR Preview 3cffa24 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

* checking PDF version of manual ... WARNING
Warning: LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
! LaTeX Error: Unicode character ⚠ (U+26A0)
               not set up for use with LaTeX.
@csouchet csouchet marked this pull request as ready for review September 12, 2023 15:36
Copy link
Member

@tbouffard tbouffard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️ Implementation
✔️ Great documentation (including documentation section reuse)
✔️ A lot of new tests
❌ README

  • missing API usage in the README of the repository to be consistent with all existing features that are referenced there
  • Consider updating the illustration image: use script of [DOC] Update the hero image #72 and [DOC] Add hero image in the README #45 (we should put the script in the doc folder instead of keeping it in comments of Pull Requests and probably rename this folder into docs for consistency with other repositories)

⚠️ Side note about the PR description: IHMO, there is no need for such a PR description when I am a reviewer. I think it was written by a ChatBot as it is very wordy and doesn't provide the information I expect to find to guide my review and write the merge commit.

  • It is mainly a list of added/updated functions and the code and R documentation should be enough to provide the same information. If not, this means that the code and/or the documentation are uncleared
  • it only states what is done where I expect to find explanations about why it is done. The code should be clear enough about the what (and if required, add code comments). I would prefer to have a clear text about the "doc section" reuse that is currently hidden in the list of links of the "to build the documentation" paragraph.

I've recently realized that this is becoming the norm in the latest PRs you've opened, and I suggest that it be adapted to help my review. Let's discuss it in person to find a solution that works for both of us.

R/funs.R Outdated Show resolved Hide resolved
inst/htmlwidgets/bpmnVisualizationR.js Outdated Show resolved Hide resolved
#'
#' @keywords internal
create_element_style <- function(elementIds,
stroke_color = NULL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: I suppose it's the R way to have dozens of parameters in a function, but it's boring and a pain to read.

Copy link
Member

@tbouffard tbouffard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
ℹ️ the image in the Readme could still be updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARN the label of the activity on top of the subprocess is not centered
The R script used to produced this image is not shared

Copy link
Member Author

@csouchet csouchet Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't use any script. I just edited the SVG image with Inkscape.
 

ℹ️ When I created this image for the first time, it was from a HTML page and it take me a long time to clean the SVG and to see the label.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't understand which activity that you mention. The label is centered:

Copy link
Member

@tbouffard tbouffard Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is how it is rendered with Firefox 117 on Ubuntu 20.04. I don't see the problem with Chrome 117.
See also the sendTask in the left
image

There was no issue with the previous image on Firefox.
We could create a dedicated issue to handle it.

image

ℹ️ When I created this image for the first time, it was from a HTML page and it take me a long time to clean the SVG and to see the label.

However, we need the script that is able to produce this rendering to be able to reproduce it.
I understand the pain about the label repositioning. Be aware of https://github.com/process-analytics/bpmn-visualization-tools/tree/v0.4.0/bpmn-visualization-svg-screenshots for the next time

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per decision with @csouchet this will be handle with #251 and #252

@csouchet csouchet merged commit c28f64b into main Sep 18, 2023
4 checks passed
@csouchet csouchet deleted the 13-Allow_to_style_BPMN_Elements branch September 18, 2023 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Allow to style BPMN Elements
2 participants