Highstock.js diagram is working strange? - javascript

The problem is that if I turn off TB1S1 off before I turn TB2S1 and TB3S1 the dynamic line changes its shape, very strange. But if I let TB1S1 be on, and turn off TB2S1 and TB3S1, then the dynamic line stays perfect.
To see the problem, just turn off TB1S1, and look at the lines TB2S1 and TB3S1 changing its shape.
How can I solve this problem that the diagram holds its shape without being attached to TB1S1..?
[JSFiddle - Demo][1]
[1]: http://jsfiddle.net/2jccfson/1/
Kind regards,
Dler H.

Related

Click on MarkUp points Forge

Hi I'm trying to use this Forge markup Sample:
https://github.com/wallabyway/markupExt
i found this line in markupExt.js but nothing happen:
this.raycaster.params.PointCloud.threshold = 5;
// hit-test markup size. Change this if markup 'hover' doesn't work
but when i run the script i can't click on the points for showing cards
this is my console return:
The parameter this.raycaster.params.PointCloud.threshold = 5 sets the hit-test radius to 5 units.
The problem with that sample is that it is geared towards the world-scale of a fusion360 model, and not a Revit model.
Try the markupExt.js example taken from this Revit example: https://github.com/apprentice3d/ForgeViewerExtensions
This will help with setting up the mouseX and Y coordinates into the correct scale for the hit-test.
Sorry about that.
Let me know if that helps
Cheers
Michael

Hover only works in one point in plotly's Scatter3D

I'm trying to visualize the a variable depending on 3 more variables (test score of a ML algorithm depending on 3 hyperparameters), thus I created a 3D scatter plot. It's working well, but hover only works on one of the 100 points and I don't know why. No matter where I hover, the only info displayed is that of that that point.
I tried setting hovermode='closest' and some other stuff but nothing worked so far. How can I made hover work for all of the points?
You can see my plot here:
Thanks!
Solved.
I was setting opacity=1 and apparently you can't do that with 3D scatter plots when you set the line property.
trace = go.Scatter3d(
x=df4['param_max_features'],
y=df4['param_n_estimators'],
z=df4['mean_test_score'],
text=text,
mode='markers',
marker=dict(
size=df4.mean_fit_time * 4,
sizemode='area',
color=df4.mean_test_score,
opacity=0.99,
colorscale='Viridis',
colorbar=dict(title = 'Test score'),
line=dict(color='rgb(140, 140, 170)')
),
)
if you set opacity to any number lower than 1 it works.
Cheers!

Folding rectangles to form a cube using three.js

I am trying to make a cube with given 6 faces lying on the surface as a cube net with one face movable. Something like this:
In the above picture, there are 6 faces, one face ( blue one) is movable.
One can rotate them up together along their edges to form a “net”.
Once they think they are finished, they can press a “fold it” button – all edges turn up 90 degrees to create the cube (or may not be a cube if he hasn't joined the blue face at proper position.)
Below is intermediate status after pressing "fold it" button.
After the faces are folded it should like this:
The corresponding animation is given here: http://www.mathematikus.de/10/
(somehow that link is not working on mac)
I am not sure how to go about this. Any help is appreciated.
Thanking you in advance.
You can use hierarchy of objects.
var obj1 = new THREE.Mesh(...);
var obj2 = new THREE.Mesh(...);
obj1.add(obj2);
There's a good example of it.
So, using this principle, I made animation for folding the cube, given in your question. Of course, this is not the ultimate solution, this is just a starting point.
jsfiddle example
upd: I've updated the fiddle. You can start folding by clicking the PressMe button. Animation made with Tween.js (see the foldTheCube() function)

Highcharts paint zero axis black

I have a Highchart bar chart with negative values (with the bars then going downwards). Now I would like to paint a black line for y=0 like so: .
I haven't found a trivial way to do this and I would like to avoid directly modifing the SVG or adding a fake line chart or something. Maybe someone knows better way? I've already played around with (minor)tickInterval and (minor)gridLineColor but that wouldn't solve my problem.
you can use plot lines for this like shown in this example http://jsfiddle.net/4rpNU/
yAxis:{
plotLines:{}
}
here is the api reference for it http://api.highcharts.com/highcharts#yAxis.plotLines
Hope this will be useful for you :)

arbor.js for annotated illustration

I'm hoping to use arbor.js as a way of creating annotated illustrations.
The plan:
Fixed size canvas
Draw image to canvas – as an example i've used the silhouette of head.
Then have a mixture of fixed and floating nodes.
var data = {
nodes:{
brain-position:{},
brain-text:{'color':'green','shape':'dot','label':'brain'},
mouth-position:{},
mouth-text{'color':'green','shape':'dot','label':'mouth'},
},
edges:{
brain-position:{ brain-text },
mouth-position:{mouth-text}
}
};
sys.graft(data);
The problems i'm having is that when I try to create a statically positioned nodeBox eg.
nodeBoxes[node.name] = [50,50, w,w] it breaks the link to other linked nodes.
I'm tinkering with halfvis/src/renderer.js file from the downloaded arbor file.
Many thanks
EDIT
Below is an additional image that hopefully visualises the functionality I'm attempting. Probably should have done this first :)
nodeBoxes, in the halfvis example, is an array used to work out where to start drawing edges so the arrows don't overlap with the boxes - is that what you're using it for?
Are you trying to find a way of forcing the 'brain-position' node inside an area?
Please provide a bit more detail of what you're planning and we can probably do this.

Categories