Dynamic plots in HTML - html

I have been developing a software package to plot astronomical data in the form of a movie. It looks like this.
To do this, I export 100 tables of data from Java to gnuplot and use a bash script to turn them into a GIF. I want instead to do it in HTML and maybe Raphael.
I'm thinking that I can use a Python script to iterate through folders and build a hundred plots, and then cycle through them. Any ideas on this? How can I get them to cycle?

You will have to test performance issues, but FLOT might be just the thing for you...
here is an example of flot animating:
http://people.iola.dk/olau/flot/examples/realtime.html

I think a canvas is what you need. Just draw all the points, clear the canvas, and redraw
your code would look something like this pseduo code
for each frame
for each point
canvas.draw point at x, y
end
clear canvas
end

Even I was looking for something similar, I found this one link will be trying it out http://humblesoftware.com/flotr2/

Related

How to modify frame to 0 in motionbuilder?

I imported c3d file in motionbuilder, and found out the motion data actually starts from 175000.
Is there a way to start the animation from frame 0?
No need to script anything. Motionbuilder lets you input the start frame when importing your c3d file.
File > Motion File Import
You can try using the DopeSheet or timeline bar, select all objects, and respective keyframes and offset them manually. Note that MotionBuilder's UI doesn't do well with very large selections. If you have one point cloud it might not be too bad, but if you have several and an already crowded scene, this method will be frustrating.
The other option, assuming you can script in Python, would be to iterate all of the optical nodes, and offset all of their keyframes by -175000 frames.
If you need a starting point on scripting in Mobu: http://awforsythe.com/tutorials/pyfbsdk-1

Animate shapes / smart objects in PSD file using data/variable csv input

I'm creating a data infographic in Photoshop that inputs 'strengths / weaknesses' from a .csv file in Excel. The only thing I'd like to have is the bars that signal strength/weaknesses to adjust to the data in the csv (e.g. get longer/shorter).
To make it more clear-
Student test scores > .csv file > .psd graphic variables > if A1 = >80%, A1 psd graphic is bigger.
Essentially, I don't want to have to use illustrator to actually 'animate' the graphics. I'm wondering if there's an easier way to have flexible moving graphics per every different .csv data variable.
Would it be easier to just set each graphic itself as a pixel variable that changes? I'm hoping not. Solutions? Anyone have a script for something like this?
A script would be the best answer to your task, if you want to avoid a photoshop variable per pixel graphic.
I am mostly experienced with variable data using Illustrator, but I believe same can be accomplished with photoshop. In your case, variables would be wholly unnecessary, as you'll simply need a script which changes the drawing of your artwork based on CSV data. For example, you can have pixel or path layers named by column headers, and the script would draw or change the path shape according to the data. To get help with such a custom script, you may reach out in the Adobe Scripting forums.

How to extract the shape of MovieClip?

We have a flash application that we are planning on converting to javascript. It's a pretty simple map application with an image as the background and a bunch of simple polygon movie clips that represent destinations on the map.
I would like to iterate through each movie clip and extract the shape into an array of x,y points to redraw the polygon using an external javascript function.
Is this possible with actionscript?
If you want to export the shape coordinates at author time, you can do try the JSFL script recommented by #strille or this one or export transparent images (if that's not too limiting for your application).
If you need to export the shapes at runtime, you can use the awesome as3swf library to decompile the swf and export the shapes. Have a look at the ShapeExport wiki as there are couple of handy exporters for js like JSCanvasShapeExporter and the more generic JSONShapeExporter
There are ways you can read the coordinates from an SWF. For instance, I've written a parser in PHP (link). Getting the data doesn't help though, as it turns out. The Flash painting model is different enough from the HTML5 one enough to make transfer exceeding difficult. The main obstacle I discovered is that in Flash, a path can be filled with two fill styles: one for area enclosed by the path, the other for enclosed area considered to be "outside" by the even-odd rule (e.g. the pentagon in the middle of a star). Since the HTML5 canvas let you specify only one fill style, you can't redraw shapes from Flash accurately. I was trying to create a tool that extract shapes as SVG and was getting a lot of gap and holes in the result.
Flash Player 11.6 introduced readGraphicsData() which does exactly what you ask for.
If you need to target an earlier version, then there's no simple way to read shape coordinates from a display object with ActionScript at runtime unfortunately.
If you just want to extract the shape coordinates once someone has written a jsfl script for Flash CS3 which looks like it might be able to help you out.

The right way to print a QCView

I have put much time and effort into drawing certain 3d plots and surfaces using a Quartz Composition. Everything looks wonderful in my (Cocoa) application's QCView. However, in order to print, I am taking a snapshot of the QCView to generate an NSImage, and putting that in an NSView for my print options screen. However, lines and colors in the snapshot look horrendously aliased. Is there some other way to either directly print from my QCView, or to bypass/override taking a snapshot so that the NSImage looks as good as what's in my QCView? QCView inherits from NSView, but the built-in print method doesn't seem to work.
Thanks!
The obliteration of antialiasing might have something to do with alpha-transparency. As the lowest layer in your Composition, do you have a Clear patch set to opaque black? (It defaults to transparent black, which might be causing the problem here.)
Thanks smokris, but I found that the way to do this is to take a CGImage snapshot. I thought I'd be able to put this snapshot in an IKImageView, which preserves anti-aliasing, but IKImageView suffers from the same issue QCView, in that when print is called you get nothing in your print window.
So, the method that finally worked is to create pdf data from the CGImage snapshot using a CGPDFContext, load up an NSImageView with an NSImage generated from this pdf data, and when this goes to a print window all anti-aliasing is preserved! Very roundabout, but works like charm!

Taking an intro Flash/AS3 course; problems with MVC pattern

Okay, so I've been busting my hump the last week or so on this project for my OOP/AS3 course and this past Sunday I realized that my approach wasn't going to work so I scrapped the better part of it and started over.
Our assignment is to create an XML based flash menu that demonstrates an understanding of the OOP patterns we've just learned. It was kind of a 'test the waters' project where he gave us a ton of tutorials and information and told us to make our best attempt at making sense of it so I'm certain there are more efficient ways to do what I'm doing, but that's a moot point.
We need to employ at least two patterns in our menu, though at the moment I'm just focusing on MVC so that I can get the mainUI working before I finalize the second part of the UI. It essentially flows like so:
MainUI has 4 menus that slide out.
Each slider has 3 thumbnails on it.
Clicking on any of the thumbnails will move to the next part of the UI. This functionality is currently disabled.
The program runs with 0 compiler errors, but the images are not being placed on the stage correctly and I can't figure out why. All the image paths are being pulled and stored from the XML properly. The main background image is pulled once and is supposed to be only placed once (if statement that uses a count to determine whether to run the placement function or not), but it is being placed 4 times with the sliding menu image. The sliders are being placed in the correct positions (switch statement that iterates through the mainUI function in the View class and creates a separate loader for each one), but the thumbnails are not all showing up. So here is what I'm seeking help with:
The mainPanel image should only be placed once, rather than 4 times with each slider.
The sliders, while being placed correctly, must be tweened in different directions through the as (using TweenMax), but each instance is unidentifiable from the other so right now they all have an eventListener that calls the same tween method. How can I distinguish them in a way that lets me apply a different tween to each (This will likely be a concern with the thumbnail functionality later as I will need to load different XML data based on which thumb is clicked).
I have added what I hope are very informative comments to each script so hopefully people can help. Also included are images of what I want the mainUI to eventually look like and how it's coming out currently.
pastebin with all 3 classes and XML (2 hyperlink limit) - http://pastebin.com/u/crookedparadigm
top image is how the stage is outputting, bottom image is what I'd like to to be - http://imgur.com/a/bOmsS
Last quick note, stage is currently set to 600x480 with a black background. Ideally, to reinforce OOP principles, our professor wants us to avoid using the timeline or library if possible.
Any advice at all will be greatly appreciated! Thanks!
Install FlexPMD This is a very good add on( sometimes hard to install ) It basically is used to show areas of your code that you are not following standards. For example your classes lack the use of "this". And you should avoid passing parameters in constructors. It would be good practice to develop standardized writing skills while you are still new.
Looking at your code I see you are calling buildUI from within a loop.
buildUI is assigning a MainView object to mainUI.
So each time you go through a loop iteration you are reassigning mainUI.
In the end mainUI will only be the last iteration of that loop.
Not sure this is your issue but is an issue.
[EDIT]
Excellent Singleton guide for Flex SDK
Part 1
Part 2
Some Good writing on pure AS3 Singletons.
I would prolly start from scratch as your XML data is miss formatted.
your XML should resemble something like this.
<MainProject>
<MainUI>
<Thumbnail Name="Spring">
<Destination Name="Spring" Price="99" ratingPath="images/SP1/SP1rating.png" />
</Thumbnail>
<Thumbnail Name="Winter">
<Destination Name="Winter" Price="152" ratingPath="images/SP1/SP2rating.png" />
</Thumbnail>
</MainUI>
</MainProject>
Then you should have the following structure on your stage. These movieclips should be empty and already placed inside on your stage with instance name.
Stage
MenuUI MovieClip
ThumbNail1 MovieClip <- feed it thumbnail from the XML
ThumbNail2 MovieClip <- feed it thumbnail from the XML
ThumbNail3 MovieClip <- feed it thumbnail from the XML
ThumbNail4 MovieClip <- feed it thumbnail from the XML
This might be a bit too vague, just tell me if you need more details.
Hope this helps !