Skip to content

Fix an issue with GraphTool interval arrows at infinity disappearing. - #1539

Merged
pstaabp merged 1 commit into
openwebwork:developfrom
drgrice1:bugfix/graphtool-number-line-inf-point
Sep 21, 2026
Merged

pstaabp merged 1 commit into
openwebwork:developfrom
drgrice1:bugfix/graphtool-number-line-inf-point

Conversation

@drgrice1

Copy link
Copy Markdown
Member

This is caused by a change in how JSXGraph sets opacity for arrow heads for version 1.13. It sets the opacity using the opacity of the line the arrow head is attached to, and reasserts this setting after creation. Since the line for the points at infinity is always completely transparent, and so this makes the arrows transparent as well, since the interval tool setting of the fill attribute is overridden. To fix this the fill is set via an inline style instead which overrides the JSXGraph attribute and so it doesn't matter what JSXGraph internally sets its attribute to.

To test this you can use the following problem:

DOCUMENT();

loadMacros('PGstandard.pl', 'PGML.pl', 'parserGraphTool.pl', 'PGcourse.pl');

$x = random(-5,     -1);
$y = random($x + 1,  5);

$gt = GraphTool("{interval,(-inf,$x]},{interval,($y,inf)}")->with(
    numberLine     => 1,
    bBox           => [ -7, 7 ],
    ticksDistanceX => 1,
    minorTicksX    => 0,
    useBracketEnds => 0,
);

BEGIN_PGML
Graph the solution set for the compound linear inequality [`x \leq [$x]`] and [`x > [$y]`].

[_]{$gt}
END_PGML

ENDDOCUMENT();

Graph a bounded interval, and then once it is graphed move an end point to infinity (the end of the board) using either the mouse or the keyboard. Instead of it becoming an arrow, it disappears. Hovering the mouse over it, or using the arrow key again makes it appear, but it shouldn't disappear at all.

This is caused by a change in how JSXGraph sets opacity for arrow heads
for version 1.13.  It sets the opacity using the opacity of the line the
arrow head is attached to, and reasserts this setting after creation.
Since the line for the points at infinity is always completely
transparent, and so this makes the arrows transparent as well, since the
interval tool setting of the `fill` attribute is overridden.  To fix
this the fill is set via an inline style instead which overrides the
JSXGraph attribute and so it doesn't matter what JSXGraph internally
sets its attribute to.

@somiaj somiaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixes issue.

@pstaabp pstaabp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fixes the issue.

@pstaabp
pstaabp merged commit f353a0a into openwebwork:develop Sep 21, 2026
4 checks passed
pstaabp added a commit that referenced this pull request Sep 21, 2026
…nf-point-hotfix

Fix an issue with GraphTool interval arrows at infinity disappearing. (hotfix of #1539)
@drgrice1
drgrice1 deleted the bugfix/graphtool-number-line-inf-point branch September 21, 2026 12:27
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

Successfully merging this pull request may close these issues.

3 participants