Skip to content

Commit

Permalink
remove array enabling
Browse files Browse the repository at this point in the history
  • Loading branch information
pafo committed May 18, 2024
1 parent 3b1fe76 commit c85ba65
Show file tree
Hide file tree
Showing 142 changed files with 2,421 additions and 2,446 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ http://plotly-json-editor.getforge.io/
- Replaced all `offline` imports in the examples packages by just calling the `grob` package of the specified version
- all html's will now refer to the correct plotly version's cdn in the html's head
- allow defining your own head for the plot, which allows embedding the plotly.js source instead of referencing the CDN. This enables generation of offline plots
- all types with "`arrayOk: true`" should be defined as `interface{}` to allow the flexibility of javascript and let the user decide whether a single value or a slice is used.

## Official Plotly Release Notes
For detailed changes please follow the release notes of the original JS repo: https://github.com/plotly/plotly.js/releases
16 changes: 1 addition & 15 deletions examples/scatter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ func main() {
*/
t := linspace(0, 10, 100)
y := sin(t)
t2 := linspace(1.7, 11.7, 100)
y2 := sin(t2)

fig := &grob.Fig{
Data: grob.Traces{
Expand All @@ -32,18 +30,6 @@ func main() {
X: t,
Y: y,
Mode: grob.ScatterModeMarkers,
Marker: &grob.ScatterMarker{
Size: 25, // use a single value to size every marker
},
},
&grob.Scatter{
Type: grob.TraceTypeScatter,
X: t,
Y: y2,
Mode: grob.ScatterModeMarkers,
Marker: &grob.ScatterMarker{
Size: y2, // use an array to size each marker differently
},
},
},
}
Expand All @@ -65,7 +51,7 @@ func linspace(start, stop float64, points int) []float64 {
func sin(x []float64) []float64 {
y := make([]float64, len(x))
for i := 1; i < len(x); i++ {
y[i] = math.Sin(x[i]) * 50
y[i] = math.Sin(x[i])
}
return y
}
2 changes: 1 addition & 1 deletion examples/scatter/scatter.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<body>
<div id="plot"></div>
<script>
data = JSON.parse('{"data":[{"type":"scatter","marker":{"size":25},"mode":"markers","x":[0,0.1,0.2,0.30000000000000004,0.4,0.5,0.6000000000000001,0.7000000000000001,0.8,0.9,1,1.1,1.2000000000000002,1.3,1.4000000000000001,1.5,1.6,1.7000000000000002,1.8,1.9000000000000001,2,2.1,2.2,2.3000000000000003,2.4000000000000004,2.5,2.6,2.7,2.8000000000000003,2.9000000000000004,3,3.1,3.2,3.3000000000000003,3.4000000000000004,3.5,3.6,3.7,3.8000000000000003,3.9000000000000004,4,4.1000000000000005,4.2,4.3,4.4,4.5,4.6000000000000005,4.7,4.800000000000001,4.9,5,5.1000000000000005,5.2,5.300000000000001,5.4,5.5,5.6000000000000005,5.7,5.800000000000001,5.9,6,6.1000000000000005,6.2,6.300000000000001,6.4,6.5,6.6000000000000005,6.7,6.800000000000001,6.9,7,7.1000000000000005,7.2,7.300000000000001,7.4,7.5,7.6000000000000005,7.7,7.800000000000001,7.9,8,8.1,8.200000000000001,8.3,8.4,8.5,8.6,8.700000000000001,8.8,8.9,9,9.1,9.200000000000001,9.3,9.4,9.5,9.600000000000001,9.700000000000001,9.8,9.9],"y":[0,4.991670832341407,9.933466539753061,14.77601033306698,19.470917115432528,23.971276930210152,28.232123669751775,32.21088436188456,35.86780454497613,39.16634548137417,42.073549240394826,44.56036800307177,46.60195429836132,48.17790927085965,49.27248649942301,49.874749330202725,49.978680152075256,49.583240522623434,48.69238154390976,47.31500438437072,45.46487134128408,43.160468332443685,40.4248201909795,37.285260608836005,33.77315902755753,29.923607205197822,25.775068591073207,21.368994011691488,16.749407507795233,11.9624664606991,7.0560004029933605,2.0790331216645246,-2.9187071713790043,-7.887284707162433,-12.777055101341583,-17.53916138448099,-22.126022164742622,-26.49180704542467,-30.592894547135963,-34.388307959198706,-37.84012476539641,-40.91385555322054,-43.57878862067941,-45.808296837472746,-47.5801036944758,-48.87650588325485,-49.684550181673224,-49.99616287820505,-49.80823044179203,-49.12263063121662,-47.946213733156924,-46.29073411638661,-44.172732786007664,-41.61337211119504,-38.63822437779936,-35.277016278519596,-31.56333189361604,-27.53427712988188,-23.23010897068783,-18.6938332415118,-13.970774909946293,-9.108125213604751,-4.15447014087482,0.8406950242175301,5.8274602425246815,10.755999404390776,15.577068175668934,20.24249603082992,24.705667556930447,28.92198821941001,32.84932993593945,36.44845200629383,39.68339319245766,42.52183103142824,44.935404790581345,46.89999883873695,48.39598360157433,49.40841169385002,49.92716726873026,49.9470670919886,49.46791233116908,48.49449054225431,47.03652783398863,45.108591687814666,42.729945404414025,39.924355631174514,36.719854893705666,33.1484615041091,29.245859644588084,25.05104282289423,20.60592426208783,15.954918117467606,11.144495705012297,6.222721175353085,1.2387712726678883,-3.7575560230904657,-8.71633906114907,-13.588031320547206,-18.32395646259642,-22.87679468876607]},{"type":"scatter","marker":{"size":[0,48.69238154390976,47.315004384370724,45.46487134128408,43.160468332443685,40.4248201909795,37.28526060883601,33.77315902755755,29.923607205197822,25.775068591073207,21.368994011691488,16.74940750779525,11.9624664606991,7.0560004029933605,2.0790331216645246,-2.9187071713790043,-7.887284707162411,-12.777055101341583,-17.53916138448099,-22.126022164742622,-26.49180704542467,-30.592894547135945,-34.388307959198706,-37.84012476539641,-40.91385555322054,-43.57878862067941,-45.808296837472746,-47.5801036944758,-48.87650588325485,-49.684550181673224,-49.99616287820505,-49.808230441792034,-49.12263063121662,-47.946213733156924,-46.29073411638661,-44.172732786007664,-41.61337211119506,-38.63822437779936,-35.277016278519596,-31.56333189361604,-27.53427712988188,-23.23010897068783,-18.6938332415118,-13.970774909946293,-9.108125213604751,-4.15447014087482,0.8406950242175301,5.8274602425246815,10.755999404390819,15.577068175668934,20.24249603082992,24.705667556930447,28.92198821941001,32.849329935939494,36.44845200629383,39.68339319245766,42.52183103142824,44.935404790581345,46.89999883873696,48.39598360157433,49.40841169385002,49.92716726873026,49.9470670919886,49.46791233116908,48.49449054225431,47.03652783398866,45.108591687814666,42.729945404414025,39.924355631174514,36.719854893705666,33.148461504109164,29.245859644588084,25.05104282289423,20.60592426208783,15.954918117467606,11.144495705012382,6.222721175353085,1.2387712726678883,-3.7575560230904657,-8.716339061148982,-13.58803132054712,-18.323956462596335,-22.87679468876607,-27.201055544468495,-31.253532444644105,-34.99373437967712,-38.38429048817907,-41.391323454282684,-43.984787998583506,-46.138771080640325,-47.831750813509395,-49.04681150332456,-49.77181266531887,-49.99951032753518,-49.727629410199455,-48.95888645756587,-47.70096249510445,-45.96642628323379,-43.772608734421425,-41.141429748435435]},"mode":"markers","x":[0,0.1,0.2,0.30000000000000004,0.4,0.5,0.6000000000000001,0.7000000000000001,0.8,0.9,1,1.1,1.2000000000000002,1.3,1.4000000000000001,1.5,1.6,1.7000000000000002,1.8,1.9000000000000001,2,2.1,2.2,2.3000000000000003,2.4000000000000004,2.5,2.6,2.7,2.8000000000000003,2.9000000000000004,3,3.1,3.2,3.3000000000000003,3.4000000000000004,3.5,3.6,3.7,3.8000000000000003,3.9000000000000004,4,4.1000000000000005,4.2,4.3,4.4,4.5,4.6000000000000005,4.7,4.800000000000001,4.9,5,5.1000000000000005,5.2,5.300000000000001,5.4,5.5,5.6000000000000005,5.7,5.800000000000001,5.9,6,6.1000000000000005,6.2,6.300000000000001,6.4,6.5,6.6000000000000005,6.7,6.800000000000001,6.9,7,7.1000000000000005,7.2,7.300000000000001,7.4,7.5,7.6000000000000005,7.7,7.800000000000001,7.9,8,8.1,8.200000000000001,8.3,8.4,8.5,8.6,8.700000000000001,8.8,8.9,9,9.1,9.200000000000001,9.3,9.4,9.5,9.600000000000001,9.700000000000001,9.8,9.9],"y":[0,48.69238154390976,47.315004384370724,45.46487134128408,43.160468332443685,40.4248201909795,37.28526060883601,33.77315902755755,29.923607205197822,25.775068591073207,21.368994011691488,16.74940750779525,11.9624664606991,7.0560004029933605,2.0790331216645246,-2.9187071713790043,-7.887284707162411,-12.777055101341583,-17.53916138448099,-22.126022164742622,-26.49180704542467,-30.592894547135945,-34.388307959198706,-37.84012476539641,-40.91385555322054,-43.57878862067941,-45.808296837472746,-47.5801036944758,-48.87650588325485,-49.684550181673224,-49.99616287820505,-49.808230441792034,-49.12263063121662,-47.946213733156924,-46.29073411638661,-44.172732786007664,-41.61337211119506,-38.63822437779936,-35.277016278519596,-31.56333189361604,-27.53427712988188,-23.23010897068783,-18.6938332415118,-13.970774909946293,-9.108125213604751,-4.15447014087482,0.8406950242175301,5.8274602425246815,10.755999404390819,15.577068175668934,20.24249603082992,24.705667556930447,28.92198821941001,32.849329935939494,36.44845200629383,39.68339319245766,42.52183103142824,44.935404790581345,46.89999883873696,48.39598360157433,49.40841169385002,49.92716726873026,49.9470670919886,49.46791233116908,48.49449054225431,47.03652783398866,45.108591687814666,42.729945404414025,39.924355631174514,36.719854893705666,33.148461504109164,29.245859644588084,25.05104282289423,20.60592426208783,15.954918117467606,11.144495705012382,6.222721175353085,1.2387712726678883,-3.7575560230904657,-8.716339061148982,-13.58803132054712,-18.323956462596335,-22.87679468876607,-27.201055544468495,-31.253532444644105,-34.99373437967712,-38.38429048817907,-41.391323454282684,-43.984787998583506,-46.138771080640325,-47.831750813509395,-49.04681150332456,-49.77181266531887,-49.99951032753518,-49.727629410199455,-48.95888645756587,-47.70096249510445,-45.96642628323379,-43.772608734421425,-41.141429748435435]}]}')
data = JSON.parse('{"data":[{"type":"scatter","mode":"markers","x":[0,0.1,0.2,0.30000000000000004,0.4,0.5,0.6000000000000001,0.7000000000000001,0.8,0.9,1,1.1,1.2000000000000002,1.3,1.4000000000000001,1.5,1.6,1.7000000000000002,1.8,1.9000000000000001,2,2.1,2.2,2.3000000000000003,2.4000000000000004,2.5,2.6,2.7,2.8000000000000003,2.9000000000000004,3,3.1,3.2,3.3000000000000003,3.4000000000000004,3.5,3.6,3.7,3.8000000000000003,3.9000000000000004,4,4.1000000000000005,4.2,4.3,4.4,4.5,4.6000000000000005,4.7,4.800000000000001,4.9,5,5.1000000000000005,5.2,5.300000000000001,5.4,5.5,5.6000000000000005,5.7,5.800000000000001,5.9,6,6.1000000000000005,6.2,6.300000000000001,6.4,6.5,6.6000000000000005,6.7,6.800000000000001,6.9,7,7.1000000000000005,7.2,7.300000000000001,7.4,7.5,7.6000000000000005,7.7,7.800000000000001,7.9,8,8.1,8.200000000000001,8.3,8.4,8.5,8.6,8.700000000000001,8.8,8.9,9,9.1,9.200000000000001,9.3,9.4,9.5,9.600000000000001,9.700000000000001,9.8,9.9],"y":[0,0.09983341664682815,0.19866933079506122,0.2955202066613396,0.3894183423086505,0.479425538604203,0.5646424733950355,0.6442176872376911,0.7173560908995227,0.7833269096274834,0.8414709848078965,0.8912073600614354,0.9320390859672264,0.963558185417193,0.9854497299884601,0.9974949866040544,0.9995736030415051,0.9916648104524687,0.9738476308781951,0.9463000876874144,0.9092974268256816,0.8632093666488737,0.8084964038195901,0.7457052121767201,0.6754631805511506,0.5984721441039564,0.5155013718214642,0.4273798802338298,0.33498815015590466,0.23924932921398198,0.1411200080598672,0.04158066243329049,-0.058374143427580086,-0.15774569414324865,-0.25554110202683167,-0.35078322768961984,-0.44252044329485246,-0.5298361409084934,-0.6118578909427193,-0.6877661591839741,-0.7568024953079282,-0.8182771110644108,-0.8715757724135882,-0.9161659367494549,-0.951602073889516,-0.977530117665097,-0.9936910036334645,-0.9999232575641009,-0.9961646088358406,-0.9824526126243325,-0.9589242746631385,-0.9258146823277321,-0.8834546557201532,-0.8322674422239008,-0.7727644875559871,-0.7055403255703919,-0.6312666378723208,-0.5506855425976376,-0.4646021794137566,-0.373876664830236,-0.27941549819892586,-0.18216250427209502,-0.08308940281749641,0.0168139004843506,0.11654920485049364,0.21511998808781552,0.3115413635133787,0.40484992061659836,0.49411335113860894,0.5784397643882002,0.6569865987187891,0.7289690401258765,0.7936678638491531,0.8504366206285648,0.8987080958116269,0.9379999767747389,0.9679196720314867,0.9881682338770004,0.9985433453746051,0.998941341839772,0.9893582466233817,0.9698898108450863,0.9407305566797726,0.9021718337562933,0.8545989080882804,0.7984871126234903,0.7343970978741133,0.662969230082182,0.5849171928917617,0.5010208564578846,0.4121184852417566,0.3190983623493521,0.22288991410024592,0.12445442350706169,0.024775425453357765,-0.07515112046180931,-0.1743267812229814,-0.2717606264109441,-0.3664791292519284,-0.45753589377532133]}]}')
Plotly.newPlot('plot', data);
</script>
</body>
Loading

0 comments on commit c85ba65

Please sign in to comment.