Ok I had asked a question recently based on this.
But I need to narrow down more..
I need to create a network graph with nodes in flex. Once I give the input the nodes must get connected with each other if they have something in common.
The nodes must be click-able to show which other nodes it is connected to.
A simple code example will be appreciated.
Can a bubble chart be modified to do this?
Thanks
I think you can try Flare.
Take a look at the demo for Layout.
i personally think, a bubble chart is not really the right way to go ...
most simple thing - in a flex world - would be to subclass UIComponent twice, for, let's say, NodeView and ConnectionView, and then put all this into some container, with absolute positioning ...
other way would be to simply add a Sprite to a UIComponent, and do the same thing in plain AS3, simply subclassing Sprite twice ... less overhead and other problems, but will not benefit from flex features, such as styling ...
do you already have a model for the network? do nodes also have coordinates, or do you need to arrange them your self?
or, if loaded externally, can you show some sample data?
greetz
back2dos
Related
I was wondering if there was a nice way to allow users to create nodal graphs (with restrictions) as with LabView.
Something like this:
I have seen http://www.pyqtgraph.org/, which seems to have something similar, and I do intend to use PyQt as my base (though I do not mind linking in C++ code), but it doesn't quite have the look and feel I wanted.
Any pointers to the right direction would be great.
There is a Diagram Scene Example which uses the Graphics View framework to make flowchart diagrams. It is an application in which you can add flowchart shapes and text and connect the shapes by arrows. The shapes, arrows, and text can be given different colors, and it is possible to change the font, style, and underline of the text.
You can take a look at the code and see how to create custom graphics items and handle mouse events and movement of items. Then change the look and behavior as you like.
Check another diagram editor here.
[not enough reps. to comment]I too had a similar task to implement. For me it was a large and complex block diagram. It was really hard to implement using QGraphicsScene. I posted a question on SO and instantly gained enough downvotes. No one gave any useful hints. So I did the hardway. Created images of lines with transparent background and changed the style-sheet dynamically. I don't know weather this is the right way. It will be really helpful if someone gave insights on this.
I am looking for some advice in regards to getting a very quick display of our reports. The problem I am working with is I receive an XML data structure that defines our layout. The report can be anywhere from 2 to 3 pages to perhaps 20 to 30. So to make the report display as quickly as possible I would like to just render the visible portion of the report. Here are the issues I need to overcome to accomplish this and I am looking for some advice how how to accomplish this.
To get a better visualization, Think of this like a word document. The reports have sections and I want to be able to get them to display as quickly as possible.
1) Of course I do not know the height of the child components I will be adding. Is there any techniques where I can determine if the components I am adding are not include in the view port and could I trigger off scroll bar movement.
2) I was thinking of adding estimation to the children components and then using that to set the height of the parent container. then when I receive scroll bar move event, I would check if the child components have been added to the parent and if not add them. Is there anyway to get the height of a component without rendering it?
3) Does Flex support anything built in that will accomplish this.
Any other techniques would be welcome. Basically I want to get the report displayed to the user as quickly as possible and delay the rendering of components that are off the screen.
Any suggestions would be welcomed. Thanks in advance.
Added Info.
Hard to provide code since I have not coded it yet. Let me try and expand with some details. I have a Parent Container where I take the some XML and using the XML creating children components based on the information in the XML. Right now when we do this it can take a long time to render a long report. What I want to do is to reduce the rendering time by delaying the rendering of those children objects. I have looked into things like the creation policy and createDeferredContent, but not sure if this is the right way to go. Guess the general problem I need to attack is how to do you stop rendering objects once you are outside the parents viewport. What I want is an item renderer like functionality but there is no similarity between the children. Perhaps a picture might be useful (will add as soon as I get to 10 points)?
Use spark List with useVirtualLayout turned on. This is what it does.
There is always similarity between children, but if you can't find it, you can use an itemRendererFunction.
I want to create a news application for my website.
My question is how should i create drag-able panels/canvas inside another panel/canvas.
What i exactly intend to do can be seen on netvibes.com . The website has different panels of every news group, and this panel could be moved from one place to other, but in a well defined manner. And the other panel take over the place of dragged panel.
Is there any component in flex, which can help me make something like that.
If i was unable to make my question clear, plz let me know, i will try to make it more clear.
Regards
Zeeshan
A TileList with drag and drop enabled should be able to accomplish something like that. Or, use a Spark List with a custom layout that you create.
It might be a bit tricky getting the list elements to drag and drop based on clicking the title, but it should be doable.
I think you should consider a more advanced solution with drap-n-drop with a custom panel based component. The places the panels can move can be implemented with a different custom canvas based component. The advantage would be to move the components into different custom positions and panels can be resized independent of each other.
Adobe has some good tutorials for drag-drop operations.
For developing simple games with the Flex SDK, what are the consequences of using a Canvas object, versus a UIComponent object, as a drawing surface? Are there performance issues with either one? Are the methods generally the same? Searching around, it seems that most sample code I've found uses UIComponent. Is this just customary, or are there reasons?
I already know one odd difference - I had developed a simple Pong game using:
public class MyGameCanvas extends UIComponent
and then decided to replace UIComponent with Canvas. This caused the line to fail:
addChild(paddle);
After spending too many hours searching, I finally found that a Canvas object requires:
rawChildren.addChild(paddle);
due to the inheritance chain of objects, Sprites being higher than Canvas.
But that doesn't seem like a reason to prefer one class to another. Are there any specific reasons? Thanks.
Update:
Okay, I guess Canvas is out, and UIComponent is in. The only reason I even tried a Canvas object is the name. I mean, it's a Canvas - isn't that where you're supposed to do drawing? :)
So the second question that has popped up is about using the Flex SDK (and I don't know if this should be a totally new question, or here is okay).
However, I have to confirm something, being new to Flex and the various terminology. I'm presuming that people mean I should not be using MXML for games, when they said Flex SDK. Since I thought the Flex SDK was what provided the compiler that generates .swf files. Otherwise, where/how would I even compile AS3?
Assuming that's the case, then my question would be about the suitability of using both MXML and AS3 for (simple) games. Based on what I've read about both, it seemed like the intended use of them was MXML for the interface elements, and AS3 for everything else. Is the overhead that bad for MXML?
John C>
I think there is no point at all to use flex sdk to develop a game.
Flex SDK has been designed with application development in mind so you shouldn't use it to make games.
Do you have specific reasons to use it instead of a plain AS3 project?
Canvas has a bunch of extra layout code, plus scrollbars. It's definitely heavier than UIComponent alone. Also, it's important to know that Canvas requires all children to be subclasses of UIComponent. Using rawChildren to add non UIComponent is a hack unless you're building some sort of "chrome" for a Flex container (scrollbars on Canvas and the border/background in Panel).
I agree with PeZ, though. The Flex framework probably isn't the right choice for a game. Unless you have a game UI with things like DataGrids, Trees, Charts, etc., you can get a smaller and more optimized SWF without Flex.
If you dont need the additional stuff in canvas, like the scrollbars, that's clearly a reason to prefer UIComponent. Canvas is just an heavier object.
I'm building a Flex app that includes an area chart, and when users hover over an AreaSeries, I'd like them to see the DataTip for the nearest data point in the series. The problem is that as far as I can tell (and I should admit at this point to being fairly new to Flex), mouseSensitivity is the only way to control when data tips appear.
If I set that to, say, 1000 pixels and tell Flex to only show a single data tip, that sometimes works, but frequently, the nearest data point is not one in the series on which the user is hovering (and in any case, it starts acting odd with such a high mouseSensitivity).
So my question, in short, is how to exert fairly direct control over which data tip is being shown at any given time. Thank you in advance.
Unfortunately i don't think there would be a straight forward method of achieving this just using a charts default members. I would expect you'd need to extend the chart component you were using and tie in with the internal workings of the chart. This isn't such an easy thing to do and the inner workings of the chart components are pretty complex. Something that isn't helped by a fairly messy implementation inside some of the classes.
There are obviously several directions you could take in solving this particular problem some that are more elegant than others.
It's defiantly possible but it's probably not a job for someone that is relatively new to flex. If i were you i would probably try to find a compromise to your requirements until you feel more comfortable delving into the chart components code.
IF you do decide to give it a go then you should come back with specific problems as myself and others are probably reluctant to solve such a big problem.
Keep the hitTest() method in mind: this is often the mouse-related unity of last resort.
Cheers