Tips for incorporating CSS styling into imported joint js bpmn elements

Our dashboard now includes components from a company supplying us with Business Process Model And Notation (BPMN) json objects.

We bring in the BPMN json object using "fromJSON()" onto the joint.dia.Paper.

Everything is functioning properly.

However, I am unsure how to customize the styling of this object. How can I add CSS or other styling options to my imported object?

Appreciate any help you can provide :-)

Answer №1

UPDATE:

To make this compatible with Rappid 2.0:

The CSS should function correctly, for example:

<style>
    .joint-theme-bpmn[data-type='bpmn.Event'] circle {
        stroke: red;
    }
</style>

Here, the data-type matches the property type of the specific element:

    joint.shapes.bpmn.Event = joint.dia.Element.extend({

        // ... markup ... 

        defaults: joint.util.deepSupplement({
            type: 'bpmn.Event',
            // attrs: {
            // ...

For versions 1.x:

Instead of using the attribute data-type, you will find a class name without the dot (.), so for the bpmn.Event type, it may look like this:

<g id="j_46" model-id="083..." class="element bpmn Gateway" ">...</g>

In this case, the following CSS code should work:

 <style>
        .bpmn.Event circle {
            stroke: red;
        }

    </style> 

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Invoke PHP function using Ajax requests

I had a query - how can you invoke multiple PHP functions and display their output on the webpage? After some exploration, I have figured out one way to do it. Can anyone provide suggestions on how I can enhance my approach? It's functioning properly ...

Connectwise Ticket API: Invalid ServiceNote Object- The API has encountered a Service

I have been attempting to append a note to an existing ticket using the rest api endpoint: cw.mycompany.com/v4_6_release/apis/3.0/service/tickets/1327224/notes request body: { "text":"Test message" } However, I am encountering the following respons ...

Slide a floating container downward by one line

I am in search of a way to create a unique text effect resembling a "sidebox" within my writing. The goal is to have a note or heading positioned at the start of a paragraph, floating either to the left or right with some negative space surrounding it and ...

Utilizing Sentiment Analysis API with Ionic 2 Angular and handling CORS restrictions

Currently, I am in the process of developing a mobile application that can analyze an individual's thoughts using the Aylien Sentiment Analysis API. The technology stack I am utilizing includes Ionic 2 and Angular 4. While I have successfully integrat ...

In Vue, emitting does not trigger the parent component to update its properties

The emit is functioning properly, as I can observe in the vue developer tool. However, the property in the parent element is not updating. Child Component: <template> <div> <ul> <li v-for="(option, index) in opt ...

Is it possible for me to reconstruct the "reducer" each time the useReducer hook is rendered?

Here is an example taken from: https://reactjs.org/docs/hooks-reference.html#usereducer const initialState = {count: 0}; function reducer(state, action) { switch (action.type) { case 'increment': return {count: state.count + 1}; ...

What could be causing my Vue application to not launch after executing `npm run serve`?

These past 24 hours have been a struggle for me. I recently embarked on the journey of learning Javascript, and my choice of JS framework was Vue JS. However, when I run npm run serve, my Vue JS app bombards me with numerous errors that seem to make no se ...

What is the process for retrieving data through a server-side API request?

I have been working on setting up my API URL in my Node.js backend application. I initially passed the entire URL in my frontend AJAX call, but now I want to transition to a server-side API call to avoid exposing the URL. Since I am not very experienced wi ...

Could you explain the significance of the typscript parameters encapsulated within curly braces?

I'm confused about the syntax in this TypeScript code snippet. Why is the data parameter enclosed in curly braces and followed by a colon and the same data object with a type specification? Can someone explain what this means? addArrivingTruckSuggesti ...

What is causing the <a> elements not to align in the center of my <li> navigation items?

I'm in the process of building a website with a mobile-first approach. Right now, I'm focusing on styling the navigation bar, which consists of a ul containing five li elements and an a element within each li. In the mobile layout, my goal is to ...

Adjusting the width of a button can result in gaps forming between neighboring buttons

I am currently working on a calculator project that involves customizing the width of a specific button with the ID equal. However, when I adjust the width of this button, it results in unexpected spacing between the third and fourth buttons in each row, c ...

"Learn the process of setting a variable in ng-model within an input field based on a specific condition

I need to dynamically assign an ng-model variable based on a condition. For instance: <input type="text" ng-model="item.model[multilang]" > The $scope.multilang variable can be set to either "ENG", "JP" (languages) or false. So, when multilang = "E ...

Change occurring within a cell of a table that has a width of 1 pixel

In the code snippet below, there is a transition inside a table cell with a width of 1px to allow it to wrap its content. However, the table layout changes only at the end or beginning of the transition: var animator = document.getElementById("animator" ...

What's going on with the final item in the array?

As I work on the exercise found at , I have devised a solution that has been successfully tested with smaller arrays containing around 5-7 elements. class ListNode { val: number next: ListNode | null constructor(val?: number, next?: ListNode | ...

Steps for bringing the image to the front and changing the background color to black

I am trying to create a function where a button calls the ID image. However, I want the background div image to be unclickable and for the image to appear in front of all other divs when the page is loading. What CSS style should I add to achieve this? ...

Exploring the possibilities of device orientation in combination with 3D transforms

Imagine a project that aims to create a cube with sides representing different geolocations. The cube's sides for east, west, up, ground, north, and south are meant to always point in their respective directions. To gather the necessary data, the proj ...

Tips for preventing scrolling on iOS in Chrome or Safari using CSS, JavaScript, or jQuery

I've successfully implemented an input element with a click event listener that triggers a function to make another element visible using the CSS rule "display:block;". The element in question has the following styling rules: .elementExample { d ...

I am looking to create a press event using JavaScript libraries like jQuery or Dojo. What is the

When using a touch screen, there is a special trick that can be done to reveal secret windows. If the center of the screen is pressed for 20 seconds, an alert will pop up saying "This is a secret window". Pressing each corner of the touch screen (to ...

5 columns squared in Bootstrap 5

Is it possible to make a .rows column (e.g col-sm-4) square shaped? I want each column to have equal width and height. <div class="row"> <div class="col-sm-4">I'm squared</div> <div class="col-sm-4&q ...

Unusual behavior observed with Chrome image resizing

I've encountered an odd issue with Chrome related to image resizing when the window size changes. When I have Chrome snapped fullscreen in Windows (double-clicking to snap), and then unsnap the window, the images are not scaling correctly back to the ...