Gordon Watts


Hi,

A few things about the Gauge display block. I like it, mostly. I'd like to modify the font and coloring and size of the text that is displayed -- it looks too big on my screen. Also, it has this odd habit of flashing. Finally, I'd like to put a small label in the middle of the dial (similar to what is done when you label a clock sidebar gadget). Finally, I was curious if I could change the size of the guage. So I thought I'd try to rip the block and modify it.

Turns out most of this sort of the display data is in an xaml file. Is that possible to modify Can I get the copy from somewhere and host the files on my own web server Or is this a feature that is coming :-)

The other thing I tried to do was create two gauge blocks to the same mashup. That didn't work - the error message was that both were trying to control the whole screen. Adding an output block that creates some simple html in addition to the html, btw, seems to work. Looking at the gauge code -- what is it that causes this condition The creationg of the silverlight control Is there a way around this with some custom html

Also (perhaps related) as I was exploring I looked at the NewsBar display block. It is a very nice and simple display block that cycles through an array and updates the html every interval. If I place two of them on a mashup at once only one works. I think this is because NewBar uses a labeled div ("_newBar") to find the html that needs to be modified. When there are two NewsBar's up there the web browser have two div's with the same ID so it can't tell. Is there a way around this issue

Finally, I love strip charts. If I wanted to write one I'd think I would write it using xaml and silverlight, rather than dhtml. Is this possible to do in the popfly context

The ability to rip blocks is just fantastic! Thanks!

Cheers,

Gordon.




Re: Possible to modify Gauge block and creating other display blocks?

AndyS


Unfortunately at the moment it isn't possible to modify the external files in the display blocks such as the XAML files and images :-(. Though we are working on getting some form of file storage sorted so you could do this unfortunatley the only way you could get access to the xaml files is by looking at the code of the block and browsing to their locations.

There are some blocks that have been created using xaml that don't require seperate files, Tim's PhotoPile is an example of that.

At the moment we don't allow users to have more than one display block in a mashup at one time. It's something we will consider though as it some cases it would seem to make sense! Our assumption about the display block taking over the entire screen was probably taken to far...

I've not seen the NewsBar block so i couldn't comment on it. But in general it is up to the block to implement some sort of state to ensure IDs aren't resused. Alas few of our blocks do that, another reason why we didn't think to deeply about multiple display blocks. No doubt it the code for the block it would be possible so each div had a unique ID thus it could work appropriately.

In the next update we will be adding a bar graph block, so it might be worth holding out for it and see if it meets your need :-). We would be interested to hear of any scenarios you may be thinking of for using graphs.





Re: Possible to modify Gauge block and creating other display blocks?

Gordon Watts

Hi,

Thanks for the response. I'll look at the PhotoPile block to see what it looks like, thanks. I'm new to silverlight (and WPF) - though I've done a bunch of programming in windows forms. That was part of the reason I felt like I'd like to copy someone else's work as a starting point!

As far as a unique id in the HTML. Do you suggest using a random number and then storing the result as a property of the block's class Would that work Or is there another way to do it that is "easier"

The idea about composing display blocks just came from the idea that I'd like to put two small gauges next to each other to display two different things and then put them on my sidebar.

Happy to hold off. It isn't like I'm doing this during the day... :-) I'm plotting the data aquisition rate of my experiment. While the actual running number is useful, the trend is as well: has it been off for a while (broken) Is it steadily decreasing in rate (normal ). A simple dial doesn't give you history information. So I'd would set it up so it was n pixels wide, perhaps each pixel would represent 30 seconds. Then each time I added a value all the other values would march one to the left, and I'd use a timer to call it once every 30 seconds.

Another useful way to use a bar graph tool might be in histogram mode. If each bin is 10 units wide, and I have 10 bars, then each time I call it with a value, it determines the bin and increments the bin by one. Over time you'll get a frequency distribution. For example, you could do that to CPU usage and see that you are often sitting at 100% or 0% but rarely anywhere inbetween. ;-)

Are we allowed to build our own silverlight controls (I could compose several I suppose, if silverlight has the concept of a "user control").

Cheers,

Gordon.






Re: Possible to modify Gauge block and creating other display blocks?

AndyS

Just going to break these into separate points to make sure i don't miss any Smile

1) Unique ID it probably easiest to have a static variable such as:
Code Snippet

FooClass.lastID = 0;


Which then is incremented everything time a block is intialized so:
Code Snippet

this.ID = "foo"+FooClass.lastID;
FooClass.lastID++;

If you would like i could provide some more specific suggestions Smile just need to know the authors' user name and the block name.

2) Graphs with the bar graph block there is a method addBar which when invoked adds a new bad to the graph at the specified value, so you could built up data over time. But it wouldn't help you work out a gradient or trend accurately. Would work for giving a rough impression though.

3) Yipo you can build your own Silverlight controls, we just have very little support for it right now Sad as ideally you would need to upload images or separate XAML files. We are working on support for these though. For now the only real way for a user to submit XAMl blocks is by making us of "loose xaml" that is XAML that is declared in strings in javascript. PhotoPile and the magic 8 ball do this.


Thanks for the great feedback :-)





Re: Possible to modify Gauge block and creating other display blocks?

Gordon Watts

Hi,

1) Status variables. I'd forgotten that javascript had them! That will work just fine!

2) The gradient or tend is a visual thing, not mathematical (well, I suppose it is, but the value is being able to glance at something with the flick of an eye and tell what is going on in general). So, that would work. I look forward to playing with it.

3) THanks for the info -- no worries as I'm not desperate to develop new controls, just exploring the possibilities. I'll check out PhotoPile and Magic 8 ball.

Cheers,

Gordon.





Re: Possible to modify Gauge block and creating other display blocks?

Gordon Watts

Hi,

So, I looked through those two blocks and I see what is being done and how it is being done. Is there a tool to help me create the XAML Especially if I want to do an animation Or is all of this written by hand right now (I have a msdn subscription).

Cheers,

Gordon.





Re: Possible to modify Gauge block and creating other display blocks?

David Kelley

The Bar Graph block allows you to add colors to the bars and you could change how it assigns default colors if you rip the block so if certain values are with in certain ranges you could could have bars be different colors. there is no limit to how many bars so you could get a visual que of how things are going based on the bar color. Also I put on my block more info on the underlying members of this block that might be useful if you are going to rip it

http://blog.identitymine.com/blogs/david_kelley/archive/2007/06/15/popfly-blocks-go-live-bargraph-silverlight-control.aspx

also there are a number of other graph types I hope to have finished shortly that I will publish including a line and scatter chart that would be better suited to trend analysis.






Re: Possible to modify Gauge block and creating other display blocks?

Gordon Watts

Hi,

The API looks great -- I'll definately play with that. BTW, when I go to your blog it says "BarGraph undefined" when it tries to start the popfly mashup you have in there.

Cheers,

Gordon.





Re: Possible to modify Gauge block and creating other display blocks?

David Kelley

hmm... are you running 1.1 I noticed that allot of the mashups blow up when i run silverlight 1.1. I just tried it and it seems to work. Also regarding charts I did a pie chart block and scatter chart block that are on popfly now under 'blenables Pie Chart' and Blendables Scatter Chart. Granted I haven't finished either but they work. Mostly I got lazy on the Scatter Chart and havent' done any animation yet... I know boring but it works. Smile

Anyway I also put them on my blog at:

http://blog.identitymine.com/blogs/david_kelley/archive/2007/06/27/blendables-scatter-chart-popfly-block-and-silverlight-control.aspx

and

http://blog.identitymine.com/blogs/david_kelley/archive/2007/06/20/using-the-blendables-popfly-silverlight.aspx

The pie chart at least has some cool animation but I need Jared to come up with some cool mask or something to make the pie chart slices look cooler.