Plotting Equations that Bifurcate

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Plotting Equations that Bifurcate

ELS Prothero via use-livecode
I am trying to plot an equation that bifurcates by setting the points of a polygon as I iterate the equation. But I can’t figure how to handle the bifurcation. Any help will be greatly appreciated!

Roger
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
remember that a blank line in the 'points' (aka the vertexlist) is not
drawn - therefore you can put each of the branches as a subset of
points, with a blank in between

Alex.

e.g. two Y values for each X, in a single graphic ...

repeat with i = 1 to N
     put N,2*n &CR after t1
     put N,3*n &CR after t2
end repeat
set the points of grc "L1" to t1 &CR & t2


On 29/10/2020 22:03, Roger Guay via use-livecode wrote:
> I am trying to plot an equation that bifurcates by setting the points of a polygon as I iterate the equation. But I can’t figure how to handle the bifurcation. Any help will be greatly appreciated!
>
> Roger
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Thank you, Alex. I am aware of the blank line causing a break, but I can’t seem to programmatically get it (or them) in the right place. I have a smooth solid line that splits in two, and I want to maintain solid lines after the split. I must have something screwy in code.

Roger

> On Oct 29, 2020, at 4:06 PM, Alex Tweedly via use-livecode <[hidden email]> wrote:
>
> remember that a blank line in the 'points' (aka the vertexlist) is not drawn - therefore you can put each of the branches as a subset of points, with a blank in between
>
> Alex.
>
> e.g. two Y values for each X, in a single graphic ...
>
> repeat with i = 1 to N
>     put N,2*n &CR after t1
>     put N,3*n &CR after t2
> end repeat
> set the points of grc "L1" to t1 &CR & t2
>
>
> On 29/10/2020 22:03, Roger Guay via use-livecode wrote:
>> I am trying to plot an equation that bifurcates by setting the points of a polygon as I iterate the equation. But I can’t figure how to handle the bifurcation. Any help will be greatly appreciated!
>>
>> Roger
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
Last time I plotted an equation while bifurcating, I was pretty drunk, and don't remember much.

Bob S


> On Oct 29, 2020, at 15:03 , Roger Guay via use-livecode <[hidden email]> wrote:
>
> I am trying to plot an equation that bifurcates by setting the points of a polygon as I iterate the equation. But I can’t figure how to handle the bifurcation. Any help will be greatly appreciated!
>
> Roger

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Bob, that one gets a “LIKE”.

On Fri, Oct 30, 2020 at 10:28 Bob Sneidar via use-livecode <
[hidden email]> wrote:

> Last time I plotted an equation while bifurcating, I was pretty drunk, and
> don't remember much.
>
> Bob S
>
>
> > On Oct 29, 2020, at 15:03 , Roger Guay via use-livecode <
> [hidden email]> wrote:
> >
> > I am trying to plot an equation that bifurcates by setting the points of
> a polygon as I iterate the equation. But I can’t figure how to handle the
> bifurcation. Any help will be greatly appreciated!
> >
> > Roger
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
--
Stephen Barncard - Sebastopol Ca. USA -
mixstream.org
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
bob bumbled,
>
> Last time I plotted an equation while bifurcating, I was pretty drunk, and don't remember much.


I once wrote a program that compiled without error and executed on the very first try.

And, umm, the university would not have approved of what I consumed before I went to the computer lab . . .

It used random numbers to see how many landed in the circle, allowing it to compute pi as 3.2 . . .

[ulp]


Richard E. Hawkins, Esq.
The Hawkins Law Firm
3430 E. Flamingo Rd.
Suite 232
Las Vegas, NV  89121
(702) 508-8462

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Hi.

Aren't the points of your two bifurcated lines comprised of the endpoint of the "main" line, a comma, and then a line containing two new items? In other words, if your main line has the points:
34,149
235,149

then one of the bifurcated lines might have points, say:
235,149
335,249

and the other, say,
235,149
335,49

Craig

-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf Of Dr. Hawkins via use-livecode
Sent: Friday, October 30, 2020 3:58 PM
To: How to use LiveCode <[hidden email]>
Cc: Dr. Hawkins <[hidden email]>
Subject: Re: Plotting Equations that Bifurcate

bob bumbled,
>
> Last time I plotted an equation while bifurcating, I was pretty drunk, and don't remember much.


I once wrote a program that compiled without error and executed on the very first try.

And, umm, the university would not have approved of what I consumed before I went to the computer lab . . .

It used random numbers to see how many landed in the circle, allowing it to compute pi as 3.2 . . .

[ulp]


Richard E. Hawkins, Esq.
The Hawkins Law Firm
3430 E. Flamingo Rd.
Suite 232
Las Vegas, NV  89121
(702) 508-8462

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Yes, yours is a good example of a bifurcated line. But now imagine producing this line programmatically with an equation that:

Produces a constant y value of 149 as x progresses from 35 to 235 (no problem)
Then produces 2 different but simultaneous values of y as x progresses from 235 to 335. This is the problem as you don’t want the end point of the separated lines to connect. If you place an empty line in the points after each iteration beyond x 235 then you end up with the bifurcated lines being points rather than a solid line.

How to plotting programs handle this situation????

Roger

> On Oct 30, 2020, at 1:04 PM, Craig newman via use-livecode <[hidden email]> wrote:
>
> Hi.
>
> Aren't the points of your two bifurcated lines comprised of the endpoint of the "main" line, a comma, and then a line containing two new items? In other words, if your main line has the points:
> 34,149
> 235,149
>
> then one of the bifurcated lines might have points, say:
> 235,149
> 335,249
>
> and the other, say,
> 235,149
> 335,49
>
> Craig
>
> -----Original Message-----
> From: use-livecode [mailto:[hidden email]] On Behalf Of Dr. Hawkins via use-livecode
> Sent: Friday, October 30, 2020 3:58 PM
> To: How to use LiveCode <[hidden email]>
> Cc: Dr. Hawkins <[hidden email]>
> Subject: Re: Plotting Equations that Bifurcate
>
> bob bumbled,
>>
>> Last time I plotted an equation while bifurcating, I was pretty drunk, and don't remember much.
>
>
> I once wrote a program that compiled without error and executed on the very first try.
>
> And, umm, the university would not have approved of what I consumed before I went to the computer lab . . .
>
> It used random numbers to see how many landed in the circle, allowing it to compute pi as 3.2 . . .
>
> [ulp]
>
> —
> Richard E. Hawkins, Esq.
> The Hawkins Law Firm
> 3430 E. Flamingo Rd.
> Suite 232
> Las Vegas, NV  89121
> (702) 508-8462
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Let’s try this again after spellchecking:


Yes, yours is a good example of a bifurcated line. But now imagine producing this line programmatically with an equation that:

Produces a constant y value of 149 as x progresses from 35 to 235 (no problem)
Then produces 2 different but simultaneous values of y as x progresses from 235 to 335. This is the problem as you don’t want the end point of the separated lines to connect. If you place an empty line in the points after each iteration beyond x = 235 then you end up with the bifurcated lines being points rather than a solid line.

How do plotting programs handle this situation????

Sorry for my inattention!

Roger

> On Oct 30, 2020, at 3:33 PM, Roger Guay via use-livecode <[hidden email]> wrote:
>
> Yes, yours is a good example of a bifurcated line. But now imagine producing this line programmatically with an equation that:
>
> Produces a constant y value of 149 as x progresses from 35 to 235 (no problem)
> Then produces 2 different but simultaneous values of y as x progresses from 235 to 335. This is the problem as you don’t want the end point of the separated lines to connect. If you place an empty line in the points after each iteration beyond x 235 then you end up with the bifurcated lines being points rather than a solid line.
>
> How to plotting programs handle this situation????
>
> Roger
>
>> On Oct 30, 2020, at 1:04 PM, Craig newman via use-livecode <[hidden email]> wrote:
>>
>> Hi.
>>
>> Aren't the points of your two bifurcated lines comprised of the endpoint of the "main" line, a comma, and then a line containing two new items? In other words, if your main line has the points:
>> 34,149
>> 235,149
>>
>> then one of the bifurcated lines might have points, say:
>> 235,149
>> 335,249
>>
>> and the other, say,
>> 235,149
>> 335,49
>>
>> Craig
>>
>> -----Original Message-----
>> From: use-livecode [mailto:[hidden email]] On Behalf Of Dr. Hawkins via use-livecode
>> Sent: Friday, October 30, 2020 3:58 PM
>> To: How to use LiveCode <[hidden email]>
>> Cc: Dr. Hawkins <[hidden email]>
>> Subject: Re: Plotting Equations that Bifurcate
>>
>> bob bumbled,
>>>
>>> Last time I plotted an equation while bifurcating, I was pretty drunk, and don't remember much.
>>
>>
>> I once wrote a program that compiled without error and executed on the very first try.
>>
>> And, umm, the university would not have approved of what I consumed before I went to the computer lab . . .
>>
>> It used random numbers to see how many landed in the circle, allowing it to compute pi as 3.2 . . .
>>
>> [ulp]
>>
>> —
>> Richard E. Hawkins, Esq.
>> The Hawkins Law Firm
>> 3430 E. Flamingo Rd.
>> Suite 232
>> Las Vegas, NV  89121
>> (702) 508-8462
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode

On 30/10/2020 22:40, Roger Guay via use-livecode wrote:
> Let’s try this again after spellchecking:
>
>
> Yes, yours is a good example of a bifurcated line. But now imagine producing this line programmatically with an equation that:
>
> Produces a constant y value of 149 as x progresses from 35 to 235 (no problem)
> Then produces 2 different but simultaneous values of y as x progresses from 235 to 335. This is the problem as you don’t want the end point of the separated lines to connect. If you place an empty line in the points after each iteration beyond x = 235 then you end up with the bifurcated lines being points rather than a solid line.
>
> How do plotting programs handle this situation????


Here are two different ways you could do it.

1. simple - assume there would (could) be two Y values for any x, and
just calculate two series, and combine them for output.

2. harder - for each x value, keep track of the previous y value for
each series, and if necessary, put in a 'skip' plus new value plus skip ...

NB makes for a more complex polygon; each new x value after bifurcation
results in 5 lines added to the points.

on mouseup
    local tSeries1, tSeries2, thepoints
    if the shiftkey is down then

       -- the easy way - just allow for the possibility of two series of
points all along
       repeat with i = 35 to 335
          -- calculate series 1
          if i < 235 then
             put i,249 &CR after tSeries1
          else
             put i, 249+(i-235) &CR after tSeries1
          end if
          -- calculate series 2
          if i < 235 then
             -- do nothing - it's the same as series 1
          else
             put i, 249+2*(i-235) &CR after tSeries2
          end if
       end repeat

       put tSeries1 &CR & tSeries2 into thePoints
       set the points of grc "X" to thePoints
       set the foregroundColor of grc "X" to "blue"
    else
       -- the harder way - multiple series ...
       -- does each step for each series ... much more complex polygon,
but ...
       local t1, t2, tLast1, tLast2
       repeat with i = 35 to 335
          -- calculate values
          if i < 235 then
             put 249 into t1
             put 249 into t2
          else
             put 249+(i-235) into t1
             put 249+2*(i-235) into t2
          end if
          -- put in series 1
          if tLast1 is not empty then
             put i-1, tLast1 &CR & i, t1 &CR after thePoints
          end if
          -- possibly put in series 2
          if tLast1 <> tLast2 OR t1 <> t2 then
             put CR after thePoints -- blank skip over to series 2 value
             put i-1, tLast2 &CR & i, t2 &CR after thePoints
             put CR after thePoints -- blank skip back to series 1
          end if
          put t1 into tLast1
          put t2 into tLast2
       end repeat
       set the points of grc "X" to thePoints
       set the foregroundColor of grc "X" to "red"
    end if

end mouseup


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Lots of clever ideas here, Alex, but I think you’re missing the point of what I ultimately want to do. I'm building a plotting program for which I want to plot any equation including those that have multiple values of y for a given x. An equation might branch at any point and might even have multiple branches both of which are unknown before plotting.

Of course, there’s always the possibility that I’m not fully comprehending your suggestions??? What does NB stand for? Are you suggesting creating a new polygon every time a branch is detected? That just might work?!

Roger


> On Oct 30, 2020, at 4:12 PM, Alex Tweedly via use-livecode <[hidden email]> wrote:
>
>
> On 30/10/2020 22:40, Roger Guay via use-livecode wrote:
>> Let’s try this again after spellchecking:
>>
>>
>> Yes, yours is a good example of a bifurcated line. But now imagine producing this line programmatically with an equation that:
>>
>> Produces a constant y value of 149 as x progresses from 35 to 235 (no problem)
>> Then produces 2 different but simultaneous values of y as x progresses from 235 to 335. This is the problem as you don’t want the end point of the separated lines to connect. If you place an empty line in the points after each iteration beyond x = 235 then you end up with the bifurcated lines being points rather than a solid line.
>>
>> How do plotting programs handle this situation????
>
>
> Here are two different ways you could do it.
>
> 1. simple - assume there would (could) be two Y values for any x, and just calculate two series, and combine them for output.
>
> 2. harder - for each x value, keep track of the previous y value for each series, and if necessary, put in a 'skip' plus new value plus skip ...
>
> NB makes for a more complex polygon; each new x value after bifurcation results in 5 lines added to the points.
>
> on mouseup
>    local tSeries1, tSeries2, thepoints
>    if the shiftkey is down then
>
>       -- the easy way - just allow for the possibility of two series of points all along
>       repeat with i = 35 to 335
>          -- calculate series 1
>          if i < 235 then
>             put i,249 &CR after tSeries1
>          else
>             put i, 249+(i-235) &CR after tSeries1
>          end if
>          -- calculate series 2
>          if i < 235 then
>             -- do nothing - it's the same as series 1
>          else
>             put i, 249+2*(i-235) &CR after tSeries2
>          end if
>       end repeat
>
>       put tSeries1 &CR & tSeries2 into thePoints
>       set the points of grc "X" to thePoints
>       set the foregroundColor of grc "X" to "blue"
>    else
>       -- the harder way - multiple series ...
>       -- does each step for each series ... much more complex polygon, but ...
>       local t1, t2, tLast1, tLast2
>       repeat with i = 35 to 335
>          -- calculate values
>          if i < 235 then
>             put 249 into t1
>             put 249 into t2
>          else
>             put 249+(i-235) into t1
>             put 249+2*(i-235) into t2
>          end if
>          -- put in series 1
>          if tLast1 is not empty then
>             put i-1, tLast1 &CR & i, t1 &CR after thePoints
>          end if
>          -- possibly put in series 2
>          if tLast1 <> tLast2 OR t1 <> t2 then
>             put CR after thePoints -- blank skip over to series 2 value
>             put i-1, tLast2 &CR & i, t2 &CR after thePoints
>             put CR after thePoints -- blank skip back to series 1
>          end if
>          put t1 into tLast1
>          put t2 into tLast2
>       end repeat
>       set the points of grc "X" to thePoints
>       set the foregroundColor of grc "X" to "red"
>    end if
>
> end mouseup
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

mergeJSON on server problem

ELS Prothero via use-livecode
I use mergeJSON to move back an forth between json and arrays for web services. It’s currently failing when I fetch json data from another source on the Ubuntu server, while the same code and data works on MacoS - presumably due to some encoding issues.

It’s a large amount of data and I can’t debug where the issue is easily. Maybe I can use jsonImport/Export on the server? Not sure. Any thoughts?
On 31 Oct 2020, 02:29 +0000, Roger Guay via use-livecode <[hidden email]>, wrote:

> Lots of clever ideas here, Alex, but I think you’re missing the point of what I ultimately want to do. I'm building a plotting program for which I want to plot any equation including those that have multiple values of y for a given x. An equation might branch at any point and might even have multiple branches both of which are unknown before plotting.
>
> Of course, there’s always the possibility that I’m not fully comprehending your suggestions??? What does NB stand for? Are you suggesting creating a new polygon every time a branch is detected? That just might work?!
>
> Roger
>
>
> > On Oct 30, 2020, at 4:12 PM, Alex Tweedly via use-livecode <[hidden email]> wrote:
> >
> >
> > On 30/10/2020 22:40, Roger Guay via use-livecode wrote:
> > > Let’s try this again after spellchecking:
> > >
> > >
> > > Yes, yours is a good example of a bifurcated line. But now imagine producing this line programmatically with an equation that:
> > >
> > > Produces a constant y value of 149 as x progresses from 35 to 235 (no problem)
> > > Then produces 2 different but simultaneous values of y as x progresses from 235 to 335. This is the problem as you don’t want the end point of the separated lines to connect. If you place an empty line in the points after each iteration beyond x = 235 then you end up with the bifurcated lines being points rather than a solid line.
> > >
> > > How do plotting programs handle this situation????
> >
> >
> > Here are two different ways you could do it.
> >
> > 1. simple - assume there would (could) be two Y values for any x, and just calculate two series, and combine them for output.
> >
> > 2. harder - for each x value, keep track of the previous y value for each series, and if necessary, put in a 'skip' plus new value plus skip ...
> >
> > NB makes for a more complex polygon; each new x value after bifurcation results in 5 lines added to the points.
> >
> > on mouseup
> > local tSeries1, tSeries2, thepoints
> > if the shiftkey is down then
> >
> > -- the easy way - just allow for the possibility of two series of points all along
> > repeat with i = 35 to 335
> > -- calculate series 1
> > if i < 235 then
> > put i,249 &CR after tSeries1
> > else
> > put i, 249+(i-235) &CR after tSeries1
> > end if
> > -- calculate series 2
> > if i < 235 then
> > -- do nothing - it's the same as series 1
> > else
> > put i, 249+2*(i-235) &CR after tSeries2
> > end if
> > end repeat
> >
> > put tSeries1 &CR & tSeries2 into thePoints
> > set the points of grc "X" to thePoints
> > set the foregroundColor of grc "X" to "blue"
> > else
> > -- the harder way - multiple series ...
> > -- does each step for each series ... much more complex polygon, but ...
> > local t1, t2, tLast1, tLast2
> > repeat with i = 35 to 335
> > -- calculate values
> > if i < 235 then
> > put 249 into t1
> > put 249 into t2
> > else
> > put 249+(i-235) into t1
> > put 249+2*(i-235) into t2
> > end if
> > -- put in series 1
> > if tLast1 is not empty then
> > put i-1, tLast1 &CR & i, t1 &CR after thePoints
> > end if
> > -- possibly put in series 2
> > if tLast1 <> tLast2 OR t1 <> t2 then
> > put CR after thePoints -- blank skip over to series 2 value
> > put i-1, tLast2 &CR & i, t2 &CR after thePoints
> > put CR after thePoints -- blank skip back to series 1
> > end if
> > put t1 into tLast1
> > put t2 into tLast2
> > end repeat
> > set the points of grc "X" to thePoints
> > set the foregroundColor of grc "X" to "red"
> > end if
> >
> > end mouseup
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mergeJSON on server problem

ELS Prothero via use-livecode
On 10/31/20 10:27 AM, David Bovill via use-livecode wrote:
> I use mergeJSON to move back an forth between json and arrays for web services. It’s currently failing when I fetch json data from another source on the Ubuntu server, while the same code and data works on MacoS - presumably due to some encoding issues.
>
> It’s a large amount of data and I can’t debug where the issue is easily. Maybe I can use jsonImport/Export on the server? Not sure. Any thoughts?

Is this any help? Hard to tell without knowing what's failing.

https://quality.livecode.com/show_bug.cgi?id=19698

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mergeJSON on server problem

ELS Prothero via use-livecode
Thanks Mark - I may give fastjson a go.

I tracked down the problem to the "\u00a0” unicode character in the json I fetched, which was causing mergeJSON to fail. This hack fixed the issue in a temporary way.
        replace "\u00a0” with empty in episodeJson -- hack to remove "¬"

Any thoughts on safe encoding of data I fetch fro jsonrpc calls so that it plays nicely with Livecode?
On 31 Oct 2020, 18:29 +0000, Mark Wieder via use-livecode <[hidden email]>, wrote:

> On 10/31/20 10:27 AM, David Bovill via use-livecode wrote:
> > I use mergeJSON to move back an forth between json and arrays for web services. It’s currently failing when I fetch json data from another source on the Ubuntu server, while the same code and data works on MacoS - presumably due to some encoding issues.
> >
> > It’s a large amount of data and I can’t debug where the issue is easily. Maybe I can use jsonImport/Export on the server? Not sure. Any thoughts?
>
> Is this any help? Hard to tell without knowing what's failing.
>
> https://quality.livecode.com/show_bug.cgi?id=19698
>
> --
> Mark Wieder
> [hidden email]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mergeJSON on server problem

ELS Prothero via use-livecode


> On 1 Nov 2020, at 6:21 am, David Bovill via use-livecode <[hidden email]> wrote:
>
> Thanks Mark - I may give fastjson a go.
>
> I tracked down the problem to the "\u00a0” unicode character in the json I fetched, which was causing mergeJSON to fail. This hack fixed the issue in a temporary way.
> replace "\u00a0” with empty in episodeJson -- hack to remove "¬"
>
> Any thoughts on safe encoding of data I fetch fro jsonrpc calls so that it plays nicely with Livecode?

Hi David

The following seems to work without error:
put format("[ \"\\u00a0\" ]") into tJSON; get JSONToArray(tJSON); put tJSON && it[1]

Cheers

Monte
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
On 31/10/2020 02:28, Roger Guay via use-livecode wrote:

> Lots of clever ideas here, Alex, but I think you’re missing the point of what I ultimately want to do. I'm building a plotting program for which I want to plot any equation including those that have multiple values of y for a given x. An equation might branch at any point and might even have multiple branches both of which are unknown before plotting.
>
> Of course, there’s always the possibility that I’m not fully comprehending your suggestions??? What does NB stand for? Are you suggesting creating a new polygon every time a branch is detected? That just might work?!

Hi Roger. You're right - I missed the point; I jumped to the assumption
that you were asking about a fairly small, specific issue - so leapt too
quickly to a code sample. But before I address the general question(s),
let me get the little points out of the way :-)

NB - sorry, kind of common usage in British English. Actually, it's from
a Latin phrase - "Nota Bene" - meaning "note well". So basically just
'take note of'.

"a new polygon every branch" - yes, perfectly possible. Also possible is
what I did in the first case of the code sample -  a new 'sequence of
points' for each branch, and then stitch those together (with blank
lines between) into a single polygon; but that's, for now, a detail.

The essence of the problem is that your app will (somehow) develop a
number of 'sequences of *data* points' - and then those need to be
translated into equivalent sets of *display* points (by either a
plotting library, or by your own code) to allow it to be displayed
appropriately.

There are at least two possible plotting libraries that might do what
you want (or do something close enough that they could be useful). By
coincidence, they were both discussed at the San Jose LC conference in
2019.If you have access to the video / papers from that you might
already have some of the info you need; I don't know if the conference
papers are ever put out for more general usage later.

Option A. Monte described a wrapper for the JSPlot library. It's a very
powerful library capable of many kinds of graphs / plots, and very quick
and capable. The most obvious downside is that it needs to be used
within a browser widget - but well worth looking at it if you can.

Option B. I did a library called "GraphMaker" - a pure-Livecode plotting
library. It is (I think) fairly easy to use - but that may not be the
case for someone else coming to it new. I know it can handle this case
of bifurcating plots (using multiple sequences of data points). The
conference slides were a decent, if very brief, introduction; the
lengthier documentation was, maybe, not quite complete. However, it does
come with a demo app that uses the library to draw a variety of graph
types. Main advantage is it's pure LC, and hopefully easy to use - both
in understanding and in ease of integration into an app (you just create
a suitable group to contain the graph, set its rect properly and pass in
all the point data along with various parameters.  It has nowhere near
the coverage of different graph types that JSPlot does - it's basically
line, bar and scatter plots, with primary X-axis, and can have shading, etc.

Option C. Roll your own.

I'd certainly suggest investigating the use of an existing library
first. There's quite a lot of effort needs to go into determining how to
scale the data to the space available, how to label the axes, how to add
tick marks, grid lines and (perhaps) multiple Y-axes. That stuff
probably accounted for 90% of the effort of creating the library.

If you'd like to try out my library, the latest version can be found at

https://www.tweedly.org/lcms.lc/GraphMaker

(sorry - I haven't formatted it into my usual download structure - so
this is simply a page that gives links that allow you to download the 2
files you need and 2 more files you don't need.)

Of course, I'll be happy to help out in any way I can with it.

Alex.

P.S. the demo app includes an example of a 'branching' plot (Graph 3).


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Hi Alex,

Thanks for your continued interest in my little project. I have succeeded in implementing a multiple polygon approach, but it ain’t elegant as they say!

I seem to recall that I learned a lot from your GraphMaker some time ago, but as I try to review your latest on your website, I run into repeated errors about “can’t find handler gmSetCustomMarker”. I can’t seem to make any headway to resolve this. Am I supposed to do something with the “Library”? I could not find instructions anywhere.

Meanwhile, I should explain further that I am trying to expand on a stack that I built 2 or 3 years ago called CoupDeGraph which you can find in the Example Stacks of LiveCode. Put simply, I am currently trying to expand on CoupDeGraph to be able to handle double-valued equations.

Again, thanks for your help

Roger

> On Nov 3, 2020, at 4:48 PM, Alex Tweedly via use-livecode <[hidden email]> wrote:
>
> On 31/10/2020 02:28, Roger Guay via use-livecode wrote:
>
>> Lots of clever ideas here, Alex, but I think you’re missing the point of what I ultimately want to do. I'm building a plotting program for which I want to plot any equation including those that have multiple values of y for a given x. An equation might branch at any point and might even have multiple branches both of which are unknown before plotting.
>>
>> Of course, there’s always the possibility that I’m not fully comprehending your suggestions??? What does NB stand for? Are you suggesting creating a new polygon every time a branch is detected? That just might work?!
>
> Hi Roger. You're right - I missed the point; I jumped to the assumption that you were asking about a fairly small, specific issue - so leapt too quickly to a code sample. But before I address the general question(s), let me get the little points out of the way :-)
>
> NB - sorry, kind of common usage in British English. Actually, it's from a Latin phrase - "Nota Bene" - meaning "note well". So basically just 'take note of'.
>
> "a new polygon every branch" - yes, perfectly possible. Also possible is what I did in the first case of the code sample -  a new 'sequence of points' for each branch, and then stitch those together (with blank lines between) into a single polygon; but that's, for now, a detail.
>
> The essence of the problem is that your app will (somehow) develop a number of 'sequences of *data* points' - and then those need to be translated into equivalent sets of *display* points (by either a plotting library, or by your own code) to allow it to be displayed appropriately.
>
> There are at least two possible plotting libraries that might do what you want (or do something close enough that they could be useful). By coincidence, they were both discussed at the San Jose LC conference in 2019.If you have access to the video / papers from that you might already have some of the info you need; I don't know if the conference papers are ever put out for more general usage later.
>
> Option A. Monte described a wrapper for the JSPlot library. It's a very powerful library capable of many kinds of graphs / plots, and very quick and capable. The most obvious downside is that it needs to be used within a browser widget - but well worth looking at it if you can.
>
> Option B. I did a library called "GraphMaker" - a pure-Livecode plotting library. It is (I think) fairly easy to use - but that may not be the case for someone else coming to it new. I know it can handle this case of bifurcating plots (using multiple sequences of data points). The conference slides were a decent, if very brief, introduction; the lengthier documentation was, maybe, not quite complete. However, it does come with a demo app that uses the library to draw a variety of graph types. Main advantage is it's pure LC, and hopefully easy to use - both in understanding and in ease of integration into an app (you just create a suitable group to contain the graph, set its rect properly and pass in all the point data along with various parameters.  It has nowhere near the coverage of different graph types that JSPlot does - it's basically line, bar and scatter plots, with primary X-axis, and can have shading, etc.
>
> Option C. Roll your own.
>
> I'd certainly suggest investigating the use of an existing library first. There's quite a lot of effort needs to go into determining how to scale the data to the space available, how to label the axes, how to add tick marks, grid lines and (perhaps) multiple Y-axes. That stuff probably accounted for 90% of the effort of creating the library.
>
> If you'd like to try out my library, the latest version can be found at
>
> https://www.tweedly.org/lcms.lc/GraphMaker
>
> (sorry - I haven't formatted it into my usual download structure - so this is simply a page that gives links that allow you to download the 2 files you need and 2 more files you don't need.)
>
> Of course, I'll be happy to help out in any way I can with it.
>
> Alex.
>
> P.S. the demo app includes an example of a 'branching' plot (Graph 3).
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
I assume the expanded version will be called SedanDeGraph.

Scott

> On Nov 4, 2020, at 10:09 AM, Roger Guay via use-livecode <[hidden email]> wrote:
>
> Hi Alex,
>
> Thanks for your continued interest in my little project. I have succeeded in implementing a multiple polygon approach, but it ain’t elegant as they say!
>
> I seem to recall that I learned a lot from your GraphMaker some time ago, but as I try to review your latest on your website, I run into repeated errors about “can’t find handler gmSetCustomMarker”. I can’t seem to make any headway to resolve this. Am I supposed to do something with the “Library”? I could not find instructions anywhere.
>
> Meanwhile, I should explain further that I am trying to expand on a stack that I built 2 or 3 years ago called CoupDeGraph which you can find in the Example Stacks of LiveCode. Put simply, I am currently trying to expand on CoupDeGraph to be able to handle double-valued equations.
>
> Again, thanks for your help
>
> Roger
>
>> On Nov 3, 2020, at 4:48 PM, Alex Tweedly via use-livecode <[hidden email]> wrote:
>>
>> On 31/10/2020 02:28, Roger Guay via use-livecode wrote:
>>
>>> Lots of clever ideas here, Alex, but I think you’re missing the point of what I ultimately want to do. I'm building a plotting program for which I want to plot any equation including those that have multiple values of y for a given x. An equation might branch at any point and might even have multiple branches both of which are unknown before plotting.
>>>
>>> Of course, there’s always the possibility that I’m not fully comprehending your suggestions??? What does NB stand for? Are you suggesting creating a new polygon every time a branch is detected? That just might work?!
>>
>> Hi Roger. You're right - I missed the point; I jumped to the assumption that you were asking about a fairly small, specific issue - so leapt too quickly to a code sample. But before I address the general question(s), let me get the little points out of the way :-)
>>
>> NB - sorry, kind of common usage in British English. Actually, it's from a Latin phrase - "Nota Bene" - meaning "note well". So basically just 'take note of'.
>>
>> "a new polygon every branch" - yes, perfectly possible. Also possible is what I did in the first case of the code sample -  a new 'sequence of points' for each branch, and then stitch those together (with blank lines between) into a single polygon; but that's, for now, a detail.
>>
>> The essence of the problem is that your app will (somehow) develop a number of 'sequences of *data* points' - and then those need to be translated into equivalent sets of *display* points (by either a plotting library, or by your own code) to allow it to be displayed appropriately.
>>
>> There are at least two possible plotting libraries that might do what you want (or do something close enough that they could be useful). By coincidence, they were both discussed at the San Jose LC conference in 2019.If you have access to the video / papers from that you might already have some of the info you need; I don't know if the conference papers are ever put out for more general usage later.
>>
>> Option A. Monte described a wrapper for the JSPlot library. It's a very powerful library capable of many kinds of graphs / plots, and very quick and capable. The most obvious downside is that it needs to be used within a browser widget - but well worth looking at it if you can.
>>
>> Option B. I did a library called "GraphMaker" - a pure-Livecode plotting library. It is (I think) fairly easy to use - but that may not be the case for someone else coming to it new. I know it can handle this case of bifurcating plots (using multiple sequences of data points). The conference slides were a decent, if very brief, introduction; the lengthier documentation was, maybe, not quite complete. However, it does come with a demo app that uses the library to draw a variety of graph types. Main advantage is it's pure LC, and hopefully easy to use - both in understanding and in ease of integration into an app (you just create a suitable group to contain the graph, set its rect properly and pass in all the point data along with various parameters.  It has nowhere near the coverage of different graph types that JSPlot does - it's basically line, bar and scatter plots, with primary X-axis, and can have shading, etc.
>>
>> Option C. Roll your own.
>>
>> I'd certainly suggest investigating the use of an existing library first. There's quite a lot of effort needs to go into determining how to scale the data to the space available, how to label the axes, how to add tick marks, grid lines and (perhaps) multiple Y-axes. That stuff probably accounted for 90% of the effort of creating the library.
>>
>> If you'd like to try out my library, the latest version can be found at
>>
>> https://www.tweedly.org/lcms.lc/GraphMaker
>>
>> (sorry - I haven't formatted it into my usual download structure - so this is simply a page that gives links that allow you to download the 2 files you need and 2 more files you don't need.)
>>
>> Of course, I'll be happy to help out in any way I can with it.
>>
>> Alex.
>>
>> P.S. the demo app includes an example of a 'branching' plot (Graph 3).
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Oooh, I like it! How about VanDeGraph?

Roger

> On Nov 4, 2020, at 3:03 PM, scott--- via use-livecode <[hidden email]> wrote:
>
> I assume the expanded version will be called SedanDeGraph.
> —
> Scott
>
>> On Nov 4, 2020, at 10:09 AM, Roger Guay via use-livecode <[hidden email]> wrote:
>>
>> Hi Alex,
>>
>> Thanks for your continued interest in my little project. I have succeeded in implementing a multiple polygon approach, but it ain’t elegant as they say!
>>
>> I seem to recall that I learned a lot from your GraphMaker some time ago, but as I try to review your latest on your website, I run into repeated errors about “can’t find handler gmSetCustomMarker”. I can’t seem to make any headway to resolve this. Am I supposed to do something with the “Library”? I could not find instructions anywhere.
>>
>> Meanwhile, I should explain further that I am trying to expand on a stack that I built 2 or 3 years ago called CoupDeGraph which you can find in the Example Stacks of LiveCode. Put simply, I am currently trying to expand on CoupDeGraph to be able to handle double-valued equations.
>>
>> Again, thanks for your help
>>
>> Roger
>>
>>> On Nov 3, 2020, at 4:48 PM, Alex Tweedly via use-livecode <[hidden email]> wrote:
>>>
>>> On 31/10/2020 02:28, Roger Guay via use-livecode wrote:
>>>
>>>> Lots of clever ideas here, Alex, but I think you’re missing the point of what I ultimately want to do. I'm building a plotting program for which I want to plot any equation including those that have multiple values of y for a given x. An equation might branch at any point and might even have multiple branches both of which are unknown before plotting.
>>>>
>>>> Of course, there’s always the possibility that I’m not fully comprehending your suggestions??? What does NB stand for? Are you suggesting creating a new polygon every time a branch is detected? That just might work?!
>>>
>>> Hi Roger. You're right - I missed the point; I jumped to the assumption that you were asking about a fairly small, specific issue - so leapt too quickly to a code sample. But before I address the general question(s), let me get the little points out of the way :-)
>>>
>>> NB - sorry, kind of common usage in British English. Actually, it's from a Latin phrase - "Nota Bene" - meaning "note well". So basically just 'take note of'.
>>>
>>> "a new polygon every branch" - yes, perfectly possible. Also possible is what I did in the first case of the code sample -  a new 'sequence of points' for each branch, and then stitch those together (with blank lines between) into a single polygon; but that's, for now, a detail.
>>>
>>> The essence of the problem is that your app will (somehow) develop a number of 'sequences of *data* points' - and then those need to be translated into equivalent sets of *display* points (by either a plotting library, or by your own code) to allow it to be displayed appropriately.
>>>
>>> There are at least two possible plotting libraries that might do what you want (or do something close enough that they could be useful). By coincidence, they were both discussed at the San Jose LC conference in 2019.If you have access to the video / papers from that you might already have some of the info you need; I don't know if the conference papers are ever put out for more general usage later.
>>>
>>> Option A. Monte described a wrapper for the JSPlot library. It's a very powerful library capable of many kinds of graphs / plots, and very quick and capable. The most obvious downside is that it needs to be used within a browser widget - but well worth looking at it if you can.
>>>
>>> Option B. I did a library called "GraphMaker" - a pure-Livecode plotting library. It is (I think) fairly easy to use - but that may not be the case for someone else coming to it new. I know it can handle this case of bifurcating plots (using multiple sequences of data points). The conference slides were a decent, if very brief, introduction; the lengthier documentation was, maybe, not quite complete. However, it does come with a demo app that uses the library to draw a variety of graph types. Main advantage is it's pure LC, and hopefully easy to use - both in understanding and in ease of integration into an app (you just create a suitable group to contain the graph, set its rect properly and pass in all the point data along with various parameters.  It has nowhere near the coverage of different graph types that JSPlot does - it's basically line, bar and scatter plots, with primary X-axis, and can have shading, etc.
>>>
>>> Option C. Roll your own.
>>>
>>> I'd certainly suggest investigating the use of an existing library first. There's quite a lot of effort needs to go into determining how to scale the data to the space available, how to label the axes, how to add tick marks, grid lines and (perhaps) multiple Y-axes. That stuff probably accounted for 90% of the effort of creating the library.
>>>
>>> If you'd like to try out my library, the latest version can be found at
>>>
>>> https://www.tweedly.org/lcms.lc/GraphMaker
>>>
>>> (sorry - I haven't formatted it into my usual download structure - so this is simply a page that gives links that allow you to download the 2 files you need and 2 more files you don't need.)
>>>
>>> Of course, I'll be happy to help out in any way I can with it.
>>>
>>> Alex.
>>>
>>> P.S. the demo app includes an example of a 'branching' plot (Graph 3).
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Equations that Bifurcate

ELS Prothero via use-livecode
Neil DeGraph Tyson?

> On Nov 4, 2020, at 3:09 PM, Roger Guay via use-livecode <[hidden email]> wrote:
>
> Oooh, I like it! How about VanDeGraph?
>
> Roger
>
>> On Nov 4, 2020, at 3:03 PM, scott--- via use-livecode <[hidden email]> wrote:
>>
>> I assume the expanded version will be called SedanDeGraph.
>> —
>> Scott
>>
>>> On Nov 4, 2020, at 10:09 AM, Roger Guay via use-livecode <[hidden email]> wrote:
>>>
>>> Hi Alex,
>>>
>>> Thanks for your continued interest in my little project. I have succeeded in implementing a multiple polygon approach, but it ain’t elegant as they say!
>>>
>>> I seem to recall that I learned a lot from your GraphMaker some time ago, but as I try to review your latest on your website, I run into repeated errors about “can’t find handler gmSetCustomMarker”. I can’t seem to make any headway to resolve this. Am I supposed to do something with the “Library”? I could not find instructions anywhere.
>>>
>>> Meanwhile, I should explain further that I am trying to expand on a stack that I built 2 or 3 years ago called CoupDeGraph which you can find in the Example Stacks of LiveCode. Put simply, I am currently trying to expand on CoupDeGraph to be able to handle double-valued equations.
>>>
>>> Again, thanks for your help
>>>
>>> Roger
>>>
>>>> On Nov 3, 2020, at 4:48 PM, Alex Tweedly via use-livecode <[hidden email]> wrote:
>>>>
>>>> On 31/10/2020 02:28, Roger Guay via use-livecode wrote:
>>>>
>>>>> Lots of clever ideas here, Alex, but I think you’re missing the point of what I ultimately want to do. I'm building a plotting program for which I want to plot any equation including those that have multiple values of y for a given x. An equation might branch at any point and might even have multiple branches both of which are unknown before plotting.
>>>>>
>>>>> Of course, there’s always the possibility that I’m not fully comprehending your suggestions??? What does NB stand for? Are you suggesting creating a new polygon every time a branch is detected? That just might work?!
>>>>
>>>> Hi Roger. You're right - I missed the point; I jumped to the assumption that you were asking about a fairly small, specific issue - so leapt too quickly to a code sample. But before I address the general question(s), let me get the little points out of the way :-)
>>>>
>>>> NB - sorry, kind of common usage in British English. Actually, it's from a Latin phrase - "Nota Bene" - meaning "note well". So basically just 'take note of'.
>>>>
>>>> "a new polygon every branch" - yes, perfectly possible. Also possible is what I did in the first case of the code sample -  a new 'sequence of points' for each branch, and then stitch those together (with blank lines between) into a single polygon; but that's, for now, a detail.
>>>>
>>>> The essence of the problem is that your app will (somehow) develop a number of 'sequences of *data* points' - and then those need to be translated into equivalent sets of *display* points (by either a plotting library, or by your own code) to allow it to be displayed appropriately.
>>>>
>>>> There are at least two possible plotting libraries that might do what you want (or do something close enough that they could be useful). By coincidence, they were both discussed at the San Jose LC conference in 2019.If you have access to the video / papers from that you might already have some of the info you need; I don't know if the conference papers are ever put out for more general usage later.
>>>>
>>>> Option A. Monte described a wrapper for the JSPlot library. It's a very powerful library capable of many kinds of graphs / plots, and very quick and capable. The most obvious downside is that it needs to be used within a browser widget - but well worth looking at it if you can.
>>>>
>>>> Option B. I did a library called "GraphMaker" - a pure-Livecode plotting library. It is (I think) fairly easy to use - but that may not be the case for someone else coming to it new. I know it can handle this case of bifurcating plots (using multiple sequences of data points). The conference slides were a decent, if very brief, introduction; the lengthier documentation was, maybe, not quite complete. However, it does come with a demo app that uses the library to draw a variety of graph types. Main advantage is it's pure LC, and hopefully easy to use - both in understanding and in ease of integration into an app (you just create a suitable group to contain the graph, set its rect properly and pass in all the point data along with various parameters.  It has nowhere near the coverage of different graph types that JSPlot does - it's basically line, bar and scatter plots, with primary X-axis, and can have shading, etc.
>>>>
>>>> Option C. Roll your own.
>>>>
>>>> I'd certainly suggest investigating the use of an existing library first. There's quite a lot of effort needs to go into determining how to scale the data to the space available, how to label the axes, how to add tick marks, grid lines and (perhaps) multiple Y-axes. That stuff probably accounted for 90% of the effort of creating the library.
>>>>
>>>> If you'd like to try out my library, the latest version can be found at
>>>>
>>>> https://www.tweedly.org/lcms.lc/GraphMaker
>>>>
>>>> (sorry - I haven't formatted it into my usual download structure - so this is simply a page that gives links that allow you to download the 2 files you need and 2 more files you don't need.)
>>>>
>>>> Of course, I'll be happy to help out in any way I can with it.
>>>>
>>>> Alex.
>>>>
>>>> P.S. the demo app includes an example of a 'branching' plot (Graph 3).
>>>>
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12