question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to change feature color without event

See original GitHub issue

I’m trying out carto vl and I wonder If there’s a way to modify a geometry color obtained by carto without a map event. My goal is to click a button and obtain the same Feature object I get when I add an event like featureClick or so.

I’m not sure if this is related to #954

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
davidmanzanarescommented, Oct 30, 2018

Hi,

With #954 the workflow will be easier.

In the meantime, you can still do it, but it will take a little bit more of code.

If I understood correctly you want something like this (pseudo-code):

color: feature == theFeatureImInterested ? red : green

This can be expressed in CARTO VL with:

color: blend(red, green, $featureID == @selectedID)
@selectedID: -1

You’ll be able to change the selected feature with viz.variables.selectedID = 1234.

Of course, you can provide any kind of boolean-like logic as the third parameter:

color: blend(red, green, $featureCountry == 'Spain' or $featureCountry == 'France' )

Assuming you only want to have one “focused” feature this won’t be a nightmare, if you plan to have more, the only way is to use blend in a recursive manner, this is from my expericence very difficult and I would recommend to wait for #954 if that is your case.

1reaction
davidmanzanarescommented, Nov 5, 2018

We released version 0.10.0 with #1085 included, mentioned bugs should be fixed there too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ability to use different colors for events in the Calendar.
It would be nice to assign calendar events different colors to quickly identify different types of appointments. Thanks and appreciate all of ...
Read more >
How can I change the default color for calendar events ...
To change the default event colour for an individual calendar in SP2013, add a Content Editor Web Part to the page and apply...
Read more >
Change Colors Of Midi And Audio Regions without changing ...
In the inspector you can change Event/Part colors by clicking the color bar next to its name and selecting a color or scrolling...
Read more >
How do I restore the ability to change the default colour for ...
I have a Pixel 3A and I have the feature to select a color for each event. Mine comes after "Add conferencing". I...
Read more >
Assign a color category to a calendar appointment, meeting ...
From your main calendar view, right click the appointment, meeting, or event, point to Categorize Button image , and then click a color...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found