Search Unity

[Released] Graph Maker - UGUI - NGUI - DFGUI (line graphs, bar graphs, pie graphs, etc)

Discussion in 'Assets and Asset Store' started by rorakin3, Sep 26, 2013.

  1. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    @rorakin3,

    Really Awesome work. Really nice that you've improved the performance because I did noticed this issue and was going to mention it but you are way ahead of me in catching the problem.

    Looking forward to the webplayer version to try out the new goodies.

    Cheers.
     
  2. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Thanks :) Speaking of performance, I just improved it further :) I did some stress testing (3,000 data points) in the data generation example, and noticed the performance was pretty bad ~20 fps, this pretty much went away if I turned off the "refresh every frame" functionality. Most of the performance hit (~98%) was just from looping through all the points to refresh their positions. To handle this I created a cache to detect when there is a change in the point data, and now the refresh every frame only loops through all the points if there was a change from the previously cached list.

    The net effect is that the FPS went from 20 FPS to 70 FPS for my test. Basically mobile users should no longer be afraid of using the "refresh every frame" functionality. My previous recommendation was turn off that functionality and call "Refresh()" manually via code, but with the cache it's pretty safe to always leave refresh every frame on.
     
  3. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Alright, I've greatly improved the data gen webplayer! I have exposed many of the variables you can change. I did find a couple bugs while creating this, so spending the time to create this GUI / webplayer was definitely a good idea. Please post here if you find any bugs playing with it, and happy holidays!

    Webplayer link is here for convenience:
    http://www.rorakin.com/GraphMaker/Data_Gen.html

    Here are some example screens from the webplayer:

    Horizontal (instead of default vertical Real-Time Ex.), that's right time is in the y direction!
    $Data_Gen_Screen4.jpg

    Horizontal stacked percentage bar!
    $Data_Gen_Screen5.jpg

    The possibilities are pretty much endless here, so don't be surprised if you find a bug. Some "bugs" are just because that combination of parameters just doesn't make sense though. For example bar charts with series where each series has a different number of data points will definitely get messed up, and I challenge you to find any image of such a bar chart online :)
     
  4. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Finished the Daikon interactive scene :)

    Here are the webplayers:

    NGUI:
    http://www.rorakin.com/GraphMaker/Data_Gen.html

    Daikon:
    http://www.rorakin.com/GraphMaker/Data_Gen_DFGUI.html

    I'll be submitting an update very soon, which in addition to the many updates, will also increase the price. This is to thank the early adopters and be more in line with the package's value.

    The new version changes -

    1.3
    - NOTE: This version brings many changes that break backwards compatibility, highly recommend remaking your existing graphs from the new examples.
    - NEW: New interactive example scene added for both NGUI and Daikon that showcases many Graph Maker features.
    - NEW: Ability to do real-time update for an arbitrary float variable (uses reflection similar to property binding in Daikon).
    - NEW: Codebase refactored to use nearly all GUI independent code. All NGUI and Daikon specific code in a manager script.
    - NEW: Ability to automatically set x / y axis min / max values based on series point data added.
    - NEW: Ability to specify an axes type. This sets the axes positions based on a quadrant type.
    - NEW: Added an axes width variable to more easily change the width of the axes.
    - NEW: Legend entry font size variable added.
    - NEW: Connect first to last variable added, which links the first and last points. Useful for creating a circle.
    - NEW: Added hide x / y labels variables.
    - FIX: Huge performance improvement for the update every frame functionality with caching, this removed the series update boolean.
    - FIX: Resolved offset issues in Daikon due to differences in pivot / position behavior in NGUI vs Daikon.
    - FIX: Auto space based on number of points variables moved from graph script to series script.
    - FIX: Replaced point / line prefab variables with a list of prefabs to easily switch prefabs at runtime.
    - FIX: "Don't draw ... by default" and list of booleans "Hide Lines / Points" replaced with single hide points / lines boolean.
    - FIX: Changed the axis lines to always be center pivoted to resolve some axis positioning issues.
    - FIX: Fixed some vertical vs horizontal issues. Behavior is to swap many x / y specific values instead of rotate everything.
    - FIX: Tick offset float variables replaced with above vs below and right vs left booleans. The axes type automatically sets these.
     
  5. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    So, is there anything else you guys want to see / expected to see in the interactive web-player?
     
  6. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    865
    Hi i just bought this! :) I am just concerned about line quality on the graphs. Is it possible to increase the quality somewhat (I am talking about NGUI version)
     
    Last edited: Jan 7, 2014
  7. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Hey, thanks!

    Hmm, yes line quality. I think you're referring to the jagged edges? I think it is because of anti-aliasing. Let's see under project settings my webplayer should be under "Good" settings... which does have anti-aliasing disabled! Changing anti-aliasing from disabled to 2x actually makes a a pretty big difference. But, actually it looks even better if we just swap out the line prefab out with a line prefab that has transparent edges. Here is what the "Link" prefab looks like for me:

    $line_quality.jpg

    I think I will just swap out the default prefab with this one, by the way this prefab is already included in v 1.3, so to use it, just go to the link prefabs section of the series and drag and drop to replace the one currently being used "Link_2".
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Hi there,
    Sorry if maybe i missed this, is the graph maker support the latest version of NGUI?
     
  9. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Yes, plan is to have Graph Maker always support latest Daikon / NGUI. I tested with the latest version available 3.0.8 before I submitted my update, and everything worked fine.
     
  10. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    This is just what I was looking for! Unity really has an awesome assets collection.
    Would it perhaps be possible to add one-directional arrow links? I would love to be able to properly display several directed graphs for debugging on my server...
    Anyway - awesome tool. You just got another sale. :)
     
  11. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Wow, thanks for the kind words, I really appreciate! Yes, all links and nodes are created at run-time via prefab. So, you can make whatever prefab you want for the nodes / links. For links, as long as you use anchors, changing the dimensions will always keep the arrows at the end. You would need to create separate prefabs for just 1 arrow for each end, but it is easy. Should also be able to create things like animating links.
     
  12. ddeaco

    ddeaco

    Joined:
    Jan 17, 2012
    Posts:
    44
    Hi,

    I sent you a PM regarding, Graph Maker and an older version of NGUI a few days ago.

    Thanks.
     
  13. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Hey, check PM. In the future, please use my email, it is at the top of the first post. I thought I had done this, but I just updated my publisher info to also have the email, so my email should be on the product page now as well. For everyone else, the question was whether NGUI 2.7 or earlier is supported, technically the answer is no, but if you really need, I can send you the latest version of Graph Maker that worked with NGUI 2.7 or earlier (since the first couple versions of Graph Maker were created using only NGUI 2.7). If this becomes a popular request, I will probably include it as a separate install in the package itself.
     
  14. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Working on adding an animation pack now using HOTween. I think it will not be required, but an additional package to optionally import. Let me know if you want something specific.
     
  15. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Just submitted a quick update (1.3.1) to fix a small issue discovered after upgrading DFGUI from 1.0.12 to 1.0.13 . Also, added some more performance improvements. The new animation APIs are not quite ready, so didn't include them yet, next update hopefully!
     
  16. byerdelen

    byerdelen

    Joined:
    Mar 27, 2010
    Posts:
    68
    Hi rorakin,
    Very good stuff out there! I was searching for this kind of package but would be a problem if you would share the documentation? I would like to check how to use api in case I can use it well with my list arrays.
    Also I couldn't see any example on webplayers if piechart is working with NGui but there is picture there and it is written. So piecharts works well for NGUI?
    Thanks
     
  17. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Thanks for checking it out! You are right, there is currently no public documentation. The plan is to create an API and put it on the same website that hosts the webplayers, but I haven't gotten around to it yet. The current documentation of all the functionality / API is in a PDF manual, if you pm me your email I can just send it to you. I'd rather not post the PDF and link to it from the asset store, since it looks not as good as an API, and I would rather just create an API / improve my website.

    Yes, I'm sure it will work with your list arrays. The actual data for most of the graphs is a List<Vector2>. However, you don't need to specify x variable, if you are just going to evenly space the data. For example a bar graph with names on the x-axis, you would only set y data, and there is boolean variable on the series script that controls whether the x data in the Vector2 is examined at all.

    For Pie Graphs it is not List<Vector2>, but rather just List<float>. And yes, unfortunately Pie Graph is still not possible in Daikon Forge, but works great in NGUI. There are actually quite a few other features for pie graphs that are not demonstrated in a web player yet, or publicly documented. Here are some of them:

    Various sorting options (names vs numbers, ascending vs descending)
    Around a dozen label options (For example: Trolls ## (%%))
    Animations (adding / modifying / deleting data make slices grow, or resort themselves in an animation)
    Also, there is quite a bit of "Include Others" functionality. For example, your data set could be 100 things, but maybe you only want the top 5 and an "Others" slice which includes the other 95 things. The "Others" label, the "X" in "Top X", colors, and more all configurable in the pie graph script.
     
    Last edited: Jan 31, 2014
  18. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    How about using this for DaikonForge Graph Pie?
     
  19. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Oh, yea dynamic circle meshes should work. I don't think I can really use that in this package without requiring everyone to buy that unfortunately.

    Just a quick update - 1.3.1 was approved and released yesterday, and I've finished a bunch of animations for line graphs and bar charts using HOTween. I will probably post a web-player in the next day or so, so you guys can try them out. I also spent a bit of time improving the line quality, and the next update will use a different link prefab for all lines for all graphs, which will be a sliced sprite with slightly transparent edges, and so there should be no more aliasing issues (it should look good (no jagged edges) regardless of your quality settings / anti-alias settings).
     
    Last edited: Feb 5, 2014
  20. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Hey guys,

    Check out the latest stuff I'm working on for the next update here:
    http://www.rorakin.com/GraphMaker/Data_Gen_DFGUI.html

    Some of the things you may notice:
    1. An Animations tab to showcase some of the animations API I'm working on to include.
    2. Line quality improved (can compare with NGUI web-player to see difference).
    3. Added an "Auto Space X" checkbox in the graph settings. This automatically evenly spaces the data. This is mainly useful for bar charts, and has been part of Graph Maker since the very first version, I'm just now exposing it to the webplayer.
    4. Series 1 Settings / Series 2 Settings combined to single Series Settings Tab with dropdown for the series. In the future, I plan to improve the web-player so that you can dynamically add and delete series.

    Next, I'll be working on making it so you can simply set a flag on the graph script to do animations automatically, rather than making you manually call an API (e.g. when the graph first loads, and / or transitions (data changes / graph type changes, etc.))
     
  21. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    I'm thinking of integrating HOTween more deeply to be able to make enabling animation transitions easier / better.

    It looks like there are other popular packages with deep HOTween integration (https://www.assetstore.unity3d.com/#/content/8339), and there seems to be no complaints / issues about that being forced in the package.

    So I think I may also just force include HOTween in my package. Anyone have thoughts on that?
     
  22. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    I'll be submitting an update fairly soon, here are the changes:

    1.3.2
    - NEW: Animations! Example scene has been updated to demonstrate the use of the animation functions. All animations use HOTween.
    - FIX: Fixed issues for Daikon version upgrade 1.0.13 -> 1.0.14
    - FIX: Different default link prefab is now used for all lines in all graphs, which improves overall line quality.
    - FIX: Axis Graph script is now fully cached, performance should be the best it can possibly be. This removed the refresh every frame variable.
    - NOTE: These changes break backwards compatibility, but can be easily addressed
    - FIX: Prefab reference variables moved from series to graph script, so they don't need to be set for each series.
    - FIX: Line Width variable renamed to Line Scale
     
    Last edited: Feb 14, 2014
  23. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    I submitted version 1.3.2, which has the changes listed in the post above. Both NGUI and Daikon web-players have been updated, so you can play around with the animations while you wait :)
     
  24. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Now that pretty much all of Graph Maker is GUI system independent code-wise, and since it appears there are only minor differences that matter for Graph Maker between NGUI 2.7 and NGUI 3.x as far as code goes (sprite width / height are localScale), and since multiple people have requested it, I have decided to officially support NGUI 2.7! Expect to see it as a separate package in the next update (tentatively 1.3.3). I've also already created it, so if you want it now, you can also just email me your invoice.
     
    Last edited: Feb 14, 2014
  25. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Hey guys,
    I have some pretty cool features planned for the next update (1.3.3)
    - Easily dynamically add / delete series! New API for dynamically adding and removing series. The example scene will have new "Add Series" and "Delete Series" buttons which will showcase using these new functions. It is really simple to use. The colors are randomized in the example scene :)

    $DynamicAddSeries.jpg

    - Events! That's right, now you will be able to add your own custom code to handle events and add interactivity to your graphs! The example scene will also be updated to showcase this new functionality. To show this, I have added a tooltip to show the x and y data of any given point and also tween the point to make it pop out whenever you hover over a data point in the example scene:
     

    Attached Files:

    Last edited: Feb 19, 2014
  26. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    @rorakin3

    I've been so busy with another part of the project and haven't had time to respond.

    Wanted to let you know how much I appreciated the already implemented and upcoming planned features:

    1. Graph Maker is GUI system independent code-wise
    2. Hotween integration
    3. Improved overall line quality
    4. Better Performance
    5. Easily dynamically add / delete series
    6. Events: custom code to handle events and add interactivity to your graphs

    Super Awesome Work.

    Cheers.
     
  27. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Thanks rocki :)

    BTW 1.3.2 is on the store now
     
  28. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Graph Maker now has enough ratings to be rated, and it's 5 stars! Woot thanks guys, I appreciate it!
     
  29. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    I'm interested in this versus other graphing solutions.

    Could you explain briefly how you are storing and retrieving the series data that drives the graphing?
    I mean, what use is a graphing system unless you have an optimized solution for data collection, storage, and retrieval to go with it?

    ty!
     
    Last edited: Feb 23, 2014
  30. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Hi,

    Thanks for checking it out. Each series contains a List<Vector2>. Graphs contains a List of series, as well as Lists of strings for the labels. The package itself specializes in the display of the data, with dozens of parameters to customize display. There are many methods you could use to retrieve and store data, for example SQL queries on a database, static data retrieved from files, data over a network, etc, and there are people using Graph Maker that are using these complex methods.

    There is some API to generate data, such as for basic math functions, and real-time data collection from an arbitrary script variable using C# reflection similar to Daikon's property binding, but for the most part the code for data collection, retrieving, optimizing data, etc is up to you. Most all you need to do is figure out what data you want to display, convert it to strings and floats, and Graph Maker will take care of the display.
     
  31. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Just submitted 1.3.3, and updated webplayers :)

    1.3.3
    - NEW: Click and hover events have been added to make adding interactivity to graphs very easy.
    - NEW: Line padding variable added to series script to allow creating lines that don't exactly touch at the point. Useful for creating hollow points.
    - NEW: Hide x / y axis tick boolean variables added to the graph, can be used to show / hide axis ticks independently of labels and vice versa.
    - NEW: Hide legend labels boolan variable added, useful now that legend events can be added, since this can be shown in a tooltip.
    - NEW: API for dynamically instantiating and deleting series, useful if you don't know how many series you will have for a given graph.
    - NEW: NGUI 2.7 is now supported for both Unity 4 and Unity 3.5.
    - CHANGE: Data generation example scene code is now mostly GUI system independent.
    - CHANGE: Functionality in the manager script has been split up: caching, data generators, events, and path finding are now smaller separate scripts.
     
    Last edited: Feb 23, 2014
  32. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Updates are fast and furious.

    Great work.
     
  33. Smtih

    Smtih

    Joined:
    Jan 25, 2013
    Posts:
    1
    I'm messing around with using tooltips in daikon forge based off the example provided in the DF Examples folder. It seems however that the items in the legend always appear above my tooltip despite my tooltip having the highest z order in the root of the daikon UI object. (I'm using a line graph prefab)

    Any ideas why this would be?
     
    Last edited: Feb 25, 2014
  34. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Hey, make sure you are comparing z-order across the same level in the hierarchy, so make sure that the z-order of the panel of the graph is less than the tooltip. When 1.3.3 is on the store you can check the data gen example, which doesn't seem to have this problem. I pretty much copied the code for the tooltip from Daikon's example. You will see in my example, that the tooltip is a child of a UI panel which has a higher z-order than the series and background panels.
     
  35. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I bought Graph Maker today. So far I am very impressed with the asset. One of the things I looked for right away is tooltips for the data points. I see that you have added a hover event to cover this, but I think that is should be default behavior built into the asset with a boolean to turn it on and off.

    For now I will take a look at your example and implement it myself for my graph.
     
  36. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Thanks, I am glad to have impressed :)
    Yes, I think it makes sense to have some default behavior. It would be hard coded, but could be easily turned off via boolean. What do you think should be default behavior that would work for most people? "Series Name: (x, y)" with 2 decimals for x and y data?
     
  37. Linus

    Linus

    Joined:
    Feb 22, 2012
    Posts:
    112
    Graph type: line

    Is there a way I can have the x-axis always come out of 0 and not the min value?
    Is there away to to have y-labels based on min-max value be rounded to nearest hundred or thousand.

    thanks
     
  38. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi Rorakin,

    I've bought your package and i'm trying to build something like this:
    $Grafiek.png


    Is this possible with the plugin and any tips how to achieve this?
     
  39. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    I'm not sure what you mean by always come out of 0. Can you maybe post an example screenshot or link to google image that shows what you are trying to make?

    Hmm, no that is a good enhancement suggestion though. Currently, there are some variables that say "number decimals for x / y axis labels". How about just make it so when you put a negative number there that it rounds up to that? For example -2 would be "hundreds" or the nearest 10^2, and 2 is "hundreths" or the nearest 10^-2, and maybe rename the variables to make it clear that this would then be possible.

    For the colors:
    Hmm, so what do all the different colors mean? Right now different colors generally means the data is part of a different series. If they are not different series, then you could manually set the color for the different data points yourself based on your own logic. There are public functions in the series script to get these gameobjects. (getPoints(), and getLines()). Note that getPoints() returns the point gameobjects for line graphs, and for bar graphs it returns the bars.

    For the 72 KG carret:
    Is that because you are trying to call out that this is "abnormal? Is that also why it is red? I think the best way to achieve this would be to use the Graph Maker function on the series script to get the list of gameobjects for the points (GetPoints()), find the one associated with your data using the List<vector2> data (pointValues), and then change its color and also move some custom sprite you create (The KG carret and big 72) to be the same position (but above) the bar's gameobject's position.
     
    Last edited: Mar 13, 2014
  40. Linus

    Linus

    Joined:
    Feb 22, 2012
    Posts:
    112
    I would like the x axis label line to come out of 0 on the Y axis. And not from the lowest value on Y.
    In my case there will often be times where there are both negative and positive values on the graph.

    To be more specific it shows monthly profit on a business.

    My sample

    $statsample.png

    Sample from a game called Capitalism Plus
    Could not find good image samples, but you can see that even if the y label show -10.000 the x label line comes out of 0.
    $wantedstattype.png

    Will try out your suggestion for rounding Y axis values.

    Thanks
     
  41. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    That sounds good. And just y (or x) for vertical (or horizontal) bar charts.
     
  42. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
  43. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Ohh, I see. Currently there is an axesType variable, and one of the options is "AUTO_ORIGIN". This will ensure the axes are placed to the tick closest to the origin (0,0). But doesn't look like this will quite work for this case. Instead there should be an option to not have it be to the nearest tick, and also an option to do x vs. y axis independently. I will add options / variables to do this in the next update. Thanks for the screenshot.
    Oh, what I meant by "How about just make it so when you put a negative number there that it rounds up to that?" was "How about I change how the number decimals variables work". Basically, I still need to do some work to make this behave as you want. Thanks for bringing it up, and you can expect the next update to be able to handle this.

    Alright sounds good, can expect it in the next update.

    Oh, I can't believe I haven't done that yet, since that is pretty standard in other graphing applications. Thanks, I will definitely put this in the next update. I will probably make it so the labels will just always be above the bar instead of inside the bar only when the labels fits inside the bar, at least for the initial version.

    Thanks guys for helping me improve the package :)
     
    Last edited: Mar 13, 2014
  44. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Thx Rorakin for your reply. Good question about the colors i'm going to ask that from the designer she should know :) Great that it's possible to create this Graph. I'm going to work on this sunday i'll let you know if it worked out or if i'm still having questions.
     
  45. Linus

    Linus

    Joined:
    Feb 22, 2012
    Posts:
    112
    Sounds great. Thought you meant I could look into modifying the functionality of that feature. But yes I think others will be finding that feature useful as well.
     
  46. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    It turns out you can actually already do it! Just put -3 for the "Num Decimals Y Axis Labels" variable and the labels will round to the nearest thousand.
     
  47. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    Hi,

    This looks like a very nice package and something that will surely help me complete my current project.

    I however did not find any tutorial videos, except for the two videos on Youtube which do not cover the graphs (line, bar, ... etc) in detail. Also one of the recent comments on the asset store (" Guillaume Langlois") seems to state that it is very difficult to change small things and the documentation is not well written.

    I really want to purchase this asset and use it, but I need to be sure that I will be able to integrate it fast and not have to read through a lot of documentation to implement a single function.

    I would really appreciate it if you could please give an example of how easy it would be to implement a run-time or data file graph. For example can you provide a small code sample that will plot the position of first person controller as it changed through time (similar to that provided by this plugin "NGraph" which seems to be a lot similar to your product - http://www.niugnepsoftware.com/ngraph/examples/liveUpdate/). On their webpage they have provided a SimplePlotExample.cs which is what I was looking for here so that I can get a brief idea of what kind of coding would be required to quickly get it up and running.

    You have created a very polished plugin and I really want to purchase it as oppsoed to NGraph. Hope you can provide an example that will help with my purchase decision.

    Thanks,
    Sam
     
  48. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Hey there,
    Almost all Graph Maker functionality is demonstrated in the interactive example scene, including real-time updating (Real-Time Ex. from the dropdown in the series settings). "Guillaume Langliois" posted that review without ever looking at the example scene. You can tell because of his sentence: "Documentation is more or less well written, a lump of text. It refers to a Data Gen scene that does not exist." The main issue was that he installed the "Graph_Maker_NGUI_Unity_3.5" package instead of the "Graph_Maker_NGUI" package even though he was using Unity 4.2 and not Unity 3.5. I did not create the example scene for all four of the NGUI packages only the most recent version of Unity and NGUI, because it is alot of work to create the example scene (mainly creating the GUI itself, all the dropdowns, buttons, sliders, checkboxes, etc.). I do mention which NGUI package to install based on what version of NGUI and Unity version you are using in the readme.

    In general, I think the root cause of his frustration in particular was that he was hoping that animations would come out of the box with no coding effort. Unfortunately, animations can come in a variety of flavors, so I designed it such that you call some functions to do animations. However, I am now leaning towards having a bunch of default animation behavior so that 0 code is required, which can then be optionally disabled, if more advanced animation needs are required. That way you have the best of both worlds ( ability to create cool, custom animations yourself, or just use the out-of-the box provided default animations). Tinjaw also made the good point above, that it would be useful to have default behavior for interactive tooltips, rather than force the user to write some code, or even look at the example scene.

    So for real-time updating, it is actually very easy. You first need to setup some variables on the series script. It is described in more detail in the manual, but basically you just need to drag a gameobject reference that will have the script of the variable that you are interested in graphing in real-time. Also you need to specify what the script is and what the variable is using their names. This is all done in the inspector (no code for setting it up). Once you have all the references and variables related to real-time graphing setup, and that is all you do and run the scene nothing will happen! Also described in the manual, after setting it up you need to call a public function to start the real-time update, and (optionally) a function to terminate the real-time updating. It is simple as getting a reference to the series, and call series.StartRealTimeUpdate(). Notice that there are no parameters needed, or nothing else needed in the code because all the setup was done before run-time via inspector.

    And of course, if the manual is not good enough, the full code sample for real-time updating (and all other Graph Maker functionality that might require custom code such as animations and tooltips) is available in the interactive example scene "Data Gen".

    Here is basically the code from the example scene that does real-time updating (basically the Start and Stop functions are called based on the dropdown selection). "theGraph" is just a reference to the Graph Maker script that represents the graph in the example scene.

    Code (csharp):
    1. public void OnSelectionChange() {
    2.         string dropVal = theGraph.getDropdownSelection(dataGenTypesDrop);
    3.         if (dropVal == "Real-Time Ex.") {
    4.             if (runningRealTimeEx) return;
    5.             runningRealTimeEx = true;
    6.             WMG_Series tmpSeries1 = theGraph.lineSeries[0].GetComponent<WMG_Series>();
    7.             tmpSeries1.StartRealTimeUpdate();
    8.         }
    9.         else {
    10.             if (runningRealTimeEx) {
    11.                 runningRealTimeEx = false;
    12.                 WMG_Series tmpSeries1 = theGraph.lineSeries[0].GetComponent<WMG_Series>();
    13.                 tmpSeries1.StopRealTimeUpdate();
    14.                 tmpSeries1.pointValues = theGraph.GenRandomY(numPoints[0],theGraph.xAxisMinValue,theGraph.xAxisMaxValue,theGraph.yAxisMinValue,theGraph.yAxisMaxValue);
    15.                 tmpSeries1.seriesName = "Random Y";
    16.             }
    17.         }
    18.     }
     
    Last edited: Mar 24, 2014
  49. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    Hey,

    Thanks a lot for the quick response and for the detailed explanation. The primary reason I raised the comment from Asset Store was because I could not see the contents that you provide, they seem to be individual unity packages, and hence it was difficult to ascertain the reliability of the complaints. Thanks for clearing that up and its sad to see that someone put a bad review before raising his concerns on the forum.

    Based on the code it seems that the example scene you are referring to is the same as the demo you have online? I did checkout the real time update based on the hexagon object (probably a sprite) and it works really well.

    If I understand you correctly, to implement a similar real time update I would need to add a series/line script/prefab? to my DF GUI and then assign the object I want to track to one of the exposed variables. And then to update it in real time I just need to call StartRealTimeUpdate() from a script attached to the object (or the GUI?). If this is the case then I am purchasing it immediately.

    Also, would it be possible to get documentation on the method calls for the different functions, just a simple list would be more than sufficient since I will need to do a few mathematical calculations before updating the graph. In case updating the graph requires calculation of a few variables, am I correct in assuming that I would be using that same exposed variable but through a script via a function call.

    Thanks again for quickly addressing my concern.

    Sam
     
  50. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    Yea, I don't like how you can't browse the package when you have multiple packages... I will create a short tutorial video soon I think to address that.

    For documentation, yes a simple list of every available public function will be valuable. I have done this for variables in the manual, but not functions. Although, I have mentioned most of the functions in various sections throughout the manual, a simple list of all the functions in one place will also be good. I will add that list to the manual, and then can you send me an email. I will email you the manual. I had plans to create a public API much like Daikon Forge's website and API, but I haven't gotten around to it.

    For real-time updating, yes, that is exactly it.

    1. Create a graph which has a series (if you want to graph multiple things, then you need 1 series for each variable you are graphing). Adding a graph and series is simple because there are several example graph prefabs. For this step, you should just drag and drop the lineGraph prefab into your scene. (real-time graphing doesn't work with well with bar charts!)

    2. Once it is in your scene, you just navigate to the series parent which will have the "WMG_Series" script. Then you setup the variables that start with "Real Time" on the series script (every Graph Maker public variable is detailed in the manual).

    3. Create your own script. You can attach it anywhere, though the most logical place is probably on the root gameobject of the Graph itself. Get a reference to WMG_Series in your own script. The easiest way would be to create a public WMG_Series variable and drag and drop the series parent gameobject to your variable, or you could do what my example interactive scene does (get a reference to the graph and then get the series from the graph).

    4. Call StartRealTimeUpdate() when you want to start updating using the series reference from the step above.