Foundry Workshop or Quiver - Aggregation editable by user in view mode, is it possible? - palantir-foundry

Is it possible in Workshop or Quiver to expose an aggregated bar chart where aggregation property is changeable by user (in reading mode). For instance by offering to user a dropdown that lists properties to aggregate on.
I guess the function presented in this thread can do the job. And then it should be a story to create dropdown widget and chart plugged on the function result. But I miss experience in Workshop or Quiver. Can some one help me with more detail ? Thank you by advance.
I want to move from Slate to Workshop/Quiver applications without loosing this feature.

One approach is to use a Function-backed chart and the approach you linked to.
Another option is to change your data structure to a "metrics"-style schema like:
|id|main_object_foreign_key|type|timestamp|value
And then make a chart based on filtering on the metric type property with the series also set to the Type value.
This effectively lets the user control what "metrics" to show on the chart by providing them with a filter element.
There are some downsides with this approach, but adding a representation of your data in this format can bring a lot of flexibility to certain kinds of visualization or workflow building needs.

Related

Multiple data models in AngularJS app?

I'm currently rebuilding a client's small mobile page, on my own dime, as a way to learn MVC and AngularJS, and in preparation for a much larger project for another client. The page I'm learning on is a single-page online ordering app for a pita restaurant. It allows you to choose from a list of pitas, then a second View allows you to customize your pita with various vegetables, cheeses, sauces, etc., followed by a third View, a form which allows you to submit your order.
My question is about the Model. I've built a system which takes the output from the database of menu items (pitas and toppings) and generates a JSON file, the Model, for Angular to parse and display for the user, but I'm curious where the user's selections will be stored.
Do I create another Model specifically for the user's selections or do I modify the original Model to hold the user's selections in addition to the original data?
This is somewhat complicated question in the sense that there are many variables. I am just going to layout how I would approach the decision:
Modifying the existing model being passed to the client means a few things.
First, it means that I won't have another model to deal with, but that the model is not focused on one thing (SRP violation). It is specifying a model in my domain as well as the relationship it has to another thing, the order. This leads to the object being in odd states in the sense it represents different things at different times/situations.
Second, I will have do do this to all my models that maybe connected to an order. Multiplying the above problem.
Creating a new model to represent an order mean another model to deal with (creating an API/service to manage it as well). The plus side is that I will be able to keep it focused on one thing: tracking an order. This means that my other models don't have to change and I know what the object truly represents at all times.
I obviously lean toward creating a new model because it is extendable/flexible and more clear to understand/support.
This doesn't have much to do with Ng or MVC or JSON. It has more to do with creating your models to most accurately and clearly represent your domain.
There maybe other consideration as well given specifics. Let me know by commenting.

Send current state of Kendo Grid to SSRS

I am setting up a couple grids with sorting, grouping and filtering options. Once the grid is in the state the user wants, I want to use a 'Print Grid' button to send the state to ssrs 2008, to basically make a printable version of the grid. I have found how to get the state (http://jsbin.com/erefug/1/edit) but I can not find how to send it to ssrs.
I have done just a standard url to a report plenty of times, and I am thinking I somehow need to get the state info into the url, but I am at a loss on how to do that, or if it is event he way to go. Let me know what you think.

django: make html button-action dependent on state

What is the best way of handling the following fundamental situation:
Let's say I have a website where people can friend each other by clicking a button.
If two people are already friends, the same button should trigger a defriend action (in django).
One way of solving it would be to pass a state to the template/html file but since it is a such a reoccurring task I wonder if there is a standard way for handling such a situation; because state variables are not particularly nice.
There is no other way. You have to have a state defined by the existence of a row in a ManyToMany relationship between two persons.
Each time you generate a template, that state has to be passed onto the context of the template.
Now, if this state has to appear in many different views, you could use a TEMPLATE_CONTEXT_PROCESSOR to automatically add the state to each context.
This state could even be cached to avoid hitting the database each time you render a template.
Hope this helps.

How do I make a simple graph in HTML/Webmatrix?

How do I make a column graph or chart in HTML using Webmatrix and Razor? I have absolutely zero knowledge of javascript, which most Q & A seem to refer to.
I want to show a thermometer rising as the daily sales rise in our office. The data will come from my Razor SQL query, which already displays a simple numerical value. Now I have been asked to show this graphically, so salesmen can see how close to the sales target they are.
I have a daily sales figure, as a variable called nett: var nett = [sequel queries to get data]
Is there a way to create a simple graph to represent this var in cshtml?
I don't know if it could help in your project, but exists a Chart Helper for WebMatrix.
You can find more informations in this tutorial: http://www.asp.net/web-pages/tutorials/data/7-displaying-data-in-a-chart.
I've had good luck with webMatrix and http://highcharts.com but it may well be overkill for your project. It's a javascript library for charting. A popular alternative is http://perfectwidgets.com/

Iterating through array of objects, populating BarChart, and saving each as image

I am creating an option in my application to create a PDF report based on the results from the application.
The results are represented as an ArrayCollection of XMLList objects, which I am using to populate a BarChart.
To create a screenshot of each result (as a PNG), I am loading the Results Window (a Title Window) and hiding it (visible = false). I am using AlivePDF to add the capture to a PDF report.
I have been using a Timer to iterate through the results, load each result to the chart, create a delay, and then capture the image and add it to the report.
I am now questioning my strategy and I was wondering if anyone has a suggestion as to any other possibilities.
I thank you for your help in advance.
P.S. I am not creating a client/server application. I need to create the images on the client side.
UPDATE
Sorry about the confusion with my question.
Currently, I am able to iterate through the results (using the Timer), but the chart does not refresh properly before capturing the screenshot and saving as PNG.
Essentially, I am trying to see if there is any other possible solutions for iterating through the results and creating a delay so that I may be able to load a result to the chart, capture the screenshot, and add it to a PDF. Is there any other way to do this in Flex?
Initially, I was thinking of iterating through the results array using a for loop, but this was not working due to the fact that the results were not loading in time before capturing the screenshot of the chart.
Once you set the chart's data it should eventually display the updated information. However the time taken will vary upon any number of factors so your best bet is to find out what event the chart dispatches once it updates. You may at that point want to capture the PNG as a callLater just in case you need an extra frame before the visual aspects are updated.
That said, this seems like a heavy-handed solution begging for an alternative.