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

WILL requirement qualifier is missing color #25

Open
DM1122 opened this issue Nov 23, 2023 · 1 comment
Open

WILL requirement qualifier is missing color #25

DM1122 opened this issue Nov 23, 2023 · 1 comment

Comments

@DM1122
Copy link
Contributor

DM1122 commented Nov 23, 2023

The WILL requirement qualifier currently shows up with the default colour. All qualifiers should have a colour, and the colour scheme should not be hardcoded

image
Copy link

dosubot bot commented Nov 23, 2023

🤖

Hi @DM1122,

Good to see you back! I hope you're doing well.

Sure, you can add a specific color for the "WILL" requirement qualifier by modifying the go.Binding for the "fill" property of the go.Shape that represents the chip. Here's how you can do it:

$(
    go.Shape, // chip
    "RoundedRectangle",
    {
        row: 1,
        column: 0,
        width: 70,
        height: 18,
        parameter1: 100,
        strokeWidth: 0,
    },
    new go.Binding("fill", "qualifier", (qualifier) => {
        if (qualifier === "SHALL") {
            return "#06c769" // green
        } else if (qualifier === "SHOULD") {
            return "#2196f3" // blue
        } else if (qualifier === "WILL") {
            return "#f3a621" // orange, or any color you prefer
        } else {
            return "#cccccc" // default grey
        }
    })
),

In this code, we added a new condition in the function that binds the "fill" property of the chip. If the qualifier is "WILL", it will return an orange color. You can replace "#f3a621" with any color you prefer.

This solution ensures that the color scheme is not hardcoded because it uses a function to determine the color based on the "qualifier" property of the data. If you want to change the color scheme in the future, you just need to modify this function.

Unfortunately, I wasn't able to find the current color scheme used for other requirement qualifiers or the "WILL" requirement qualifier in the tree-visualizer codebase. If you have more information about this, it would be helpful to provide it.

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant