Outline color/opacity vs fill color/opacity of endpoint

I am working on creating an interactive Venn diagram. One element I’d like is a point that the user can click on that will fill that region. I am using <endpoint> to accomplish this.

Here is a MWE:

Using Endpoints to fill a region

  1. Is there a way to control the fill color independent of the outline color of the endpoint marker? I’d like the outline of the marker to be gray, but the fill color to match one of my predefined styles.
  2. Similarly, can I control the fill opacity of an endpoint independent of the line opacity?

I am avoiding using buttons because it looks cluttered (with 8 regions eventually) and <booleanInput> doesn’t allow me to control the styles at all.

I think your idea of using endpoints is really cool! I played with this for a little while, and I can’t figure out how to do what you want. It appears that endpoints are markers, and the fill of the endpoint seems to have to match the marker color in the styleDefinition. However, I don’t think it’s a bad thing the way it is, or if you changed it to gray - it helps identify where to click on when it is filled.

I thought I remembered @Anurag_Katyal saying he had an activity where students could click on either side of a line in the plane to toggle shading on and off as part of a linear inequality problem, because there was really a hidden polygon that was being filled. But I couldn’t find his activity, and I had a pretty hard time reproducing that functionality without his guidance! I did get some things which at least kind of work, and maybe identified some questions for @Duane_Nykamp1.

I ultimately just switched to gray markers for the endpoints. Here is the final version: Venn Diagram Shader

I still don’t know exactly how I will implement it. I imagine giving the student a problem like (AnB)uC’ and having them select the appropriate regions.

In case you are really bored tonight, here’s something that Duane originally helped me with.

@Chrissy_Safranski ^ was the basic idea. Except, I didn’t have the smaller circle. I just had the big circle (polygon, in my case) be the target for the change in colors.

I like it a lot! Way to go! I would suggest adding fixAxes on the graph and making the circles A and C, and the labels for U, Set A and Set C not draggable. For some reason, B and its label seems fixed already.

I like this idea.

Although the logic checking might be more complicated. I’d have to check the fill color of the larger circle instead of checking if p.open.

I may also remove the ability to shade the larger sets and their complements from my version. I really want to focus on the particular subsets and what they mean. It also makes answer checking easier if I don’t have to check region A or its component subsets.

Currently, we just have markerColor and markerOpacity. Should we simplify it, remove those, and have the markers use lineColor, lineOpacity, fillColor, and fillOpacity? I think making the fill attribute do double-duty won’t work, as one probably wants different defaults for the fill of the marker and the fill of the region.

We could add markerFillColor and markerFillOpacity, but then I don’t know how to make it not be confusing what markerColor means. We could change it to markerLineColor, markerLineOpacity, markerFillColor, markerFillOpacity(and deprecate markerColor and markerOpacity. Not sure how to keep this from getting too complicated.

Perhaps existing lineColor and lineOpacity attributes map to the endPoint outline color and opacity. My thinking is that an outline is kind of like a line? Then add we add a new attribute for markerFillColor.

Maybe I’m trying to use endPoint in a weird way? I ended up finding a different way to implement my idea that didn’t require the full color. I like being able to easily see if the point was open/closed to use it for answer checking (later).

Eh…or just check what the style number is. Either way, you are either checking whether something is open or you are checking is the style number is the correct one.

I shared it as a quick example of what Chrissy was referencing. I think it would work a lot better with individually defined regions that could be toggled on and off.

What would be killer is if students were given three (or however many) disjoint circles, they then dragged them into the correct orientation of overlaps and then toggled the regions on or off, just like one would do on paper. I shudder to think of how this would actually get accomplished. This would definitely be a textbook case of perfect being the enemy of good enough, but it’s fun to dream on Sunday nights :slight_smile:

Thanks! That’s basically what I eventually hit on as the first method in my linked document above: changing styleNumbers upon click, where one style has white fill and the other style has a different color fill.

I accomplished it by using a formula to toggle back and forth between the numbers, (if the style numbers to toggle between are 12 and 13 the new value should be 25-oldvalue) but conditionalContent is probably better and more generalizable. I also included a couple methods that didn’t work quite as well, because of course I found those first. :slight_smile: