Re: Grafica

0 views
Skip to first unread message
Message has been deleted

Tommye Hope

unread,
Jul 11, 2024, 9:01:06 PM7/11/24
to gifgesinggrat

I am also very impressed, I am tempted to port the examples to ruby-processing, there are plenty of rubyists out there looking for cool ways to present their data. Painless here it is in ruby-processing

Yeah it is dead easy to use processing libraries in ruby-processing, they just need to be installed for vanilla processing and we can pick them up. But better than that, just see how easy it is to work with csv file in ruby-processing (cf vanilla processing) in your Oktoberfest example.

grafica


DESCARGAR https://urllie.com/2yPkBM



It is most unlikely the user will want to use the default position and size so this makes it easier to create, position and size the graph in one statement. It took me awhile to find the setOuterDim method.

(2) Although the mouse controlled zooming, centering and panning work well individually they don't work well in combination. For instance if I have panning and centering both switched on, when I attempt to pan if centers on mouse down then pans on drag. Also I soon got 'lost' when zooming and centering were both switched on.

@jagracar - very nice indeed. However, just a note, and it is likely my issue as I'm fairly new to using Chrome - BUT, your examples run in FireFox, but not in my Chrome. In FireFox, every openprocessing.org sketch causes FF to display the risk dialog, to which I click Run; I'm used to this. Chrome doesn't do this; just presents the blank sketch window.

@jagracar - since the library examples show in FF means ANY problems with showing them in Chrome has NOTHING to do with this library so if you are still having problems please create a new Topic. Let us keep this topic free for comments about the Graphica library

(2) I have to think about the combination of panning and centering. Maybe when the user enables them, there should also be the option to specify the mouse button, or something like that. Which was your idea?

Since I last posted I have been playing with Graphica because I want to use it to create examples for a new library I have developed which evaluates expressions and algorithms entered by the user at run-time (QScript)

While looking at the source I found the zoom method, I agree its not much use to the user and I like your suggestion but I would also include a zoom method with a single parameter which zooms on the centre of the graph.

So now we come to the tricky bit - zooming, centering and panning together. It would be nice if the user can select to have them all active but then the library make intelligent decisions based on user input.

My first suggestion is that zoom and centering is implemented on the CLICK event rather than PRESS event this will immediately separate these functions from panning. If labeling is active then we need to distinguish between a click for labels and a click for zoom/center, I suggest that a mouse click when the shift key is pressed be used for labels, but if the shift key is not down then either zoom or center or both.

Next implementing the behaviour when the mouse is clicked and the shift button is not down. If zooming OR centering is activated (but not both) there is no problem simply perform that task. The problem comes when both are activated. The approach I suggest is that if the mouse is near the centre of the graph then zoom, if it is further away centre the graph. This has some logic in that you are more likely to center on a position away from the current center than one that is already close to the centre.

Personally I am using graphica with G4P to create examples for my new library, QScript (yet to be released). It means that the outer dimension is important to me so that it doesn't clash with the G4P controls. I notice that when I change the margins with setMar() it changes the outerDim rather than the inner dimension. That leads me to another suggestion, while reading the reference I found it difficult to work out whether it was referring to outer dim or the actual graph area. You might want to look into that ambiguous references make the learning curve steeper.

It might be interesting to add methods to extract information from Processing's Table class and display the data. Also methods that take 'raw' data and does the conversion to GPointArray for the user would male it more accessible to novices.

Also, I like "autoscaling" to find my way back to the original plot display. In the example below a double click achieves that, although a simple right click would be enough if your default panning only reacted to the leftmouse button.

Thank you for your comment gyula! And thank you for your code improvement suggestions. I was busy with other projects during the last weeks, but I hope to have some time this week to improve the library. I have to think on a better way to deal with the mouse events. I realized I need to give as much freedom as posible to the user, letting him to decide the mouse button to use, the number of clicks etc.

grafica gives more importance to the main layer (the first one) than the other ones. I guess we can find good and bad cases where this is good. One good thing is that it's faster, because it doesn't haveto loop over the layers to calculate the limits.

Hi masseyj1. Sure you can :) You can fine tune almost all the plot parameters in grafica. Take a look at the examples that come with the library. In particular the multiplePanels example shows how you can change the plot margins and the plot dimensions. You can change the margins, the outer dimension and the inner dimension (the area were the points are actually plot) using the following commands:

HiI'm using your library and I have one problem. How can I delete draw and insert new points for new draw? I receives a packet of data from the RS interfaces and would like to be represented on the graph.

1) Ability to display bitmaps (png, jpg, etc) similar to the current .svg vector image support. I found that saving my bitmaps as an .svg file didn't work most of the time. I believe it's because the .svg importer in Processing is extremely "picky" about what's in the image. Being able to use loadImage() versus loadShape() in the graphs would allow me to use .png images.

I have to think about your second point. Do you refer to the drawGridLines() method? That method uses the xAxis and yAxis ticks, which you can modify if you want. To do it you need to get the axes first with the getXAxis() and getYAxis() methods:

However, i have an issue to ask. I want to know how can i set the scale of both axis (x and y), because i'm getting different scale for each axis and that cannot provide to me a good understanding of line plotted.

I really recommend you to spend some time trying to learn how to read javadocs. It's really not that difficult and you will win a lot in the long run. Specially if you plan to use java libraries with very few examples like mine ;)

What I still could not achieve was limit zooming, panning etc to only one direction: x or y. I thought the methods setFixedXLim(true) and setFixedYLim(true) were meant for that, but they didn't work for me.

Hi @gyula. I must admit I didn't consider that possibility. The setFixedXLim(true) and setFixedYLim(true) methods fix the axis limits to the current ones, with only one exception: when the zooming and panning are activated and the user starts to use them. At that moment, the GPlot class unfixes the limits again.

What I really want is fixing the limits of only one axis (x or y) at a time with a key modifier WHILE using the mouse button of my choice (wheel for zooming, left or right button for panning, not the default buttons that plot.activatePanning() and plot.activateZooming() offer).

Since both plot.activatePanning() and plot.activateZooming() have several overloaded variants, wouldn't it be simpler to let the user decide if she wants to fix the axis limits? I cannot understand why this decision is overruled by panning and zooming.

Hi gostinets! The drawLegend method is using internally the drawAnnotation method, that uses the GLayer font. You can change the layer font properties with the setFontName(), setFontColor(), setFontSize() and setFontProperties() methods. But that will change the font in the point labels too.

Unfortunately, you cannot change the legend symbol. Currently the method is only using squares. If I find some time, i will try to create a separate GLegend object with it's own text and symbol properties.

Los trabajos se enviarn a travs del sitio web de la revista. Para hacerlo, hay que estar registrado como autor, entrar con el nombre de usuario y contrasea y hacer un nuevo envo.
En caso de no estar registrado, puede hacerlo en
Para el proceso de evaluacin es necesario enviar una versin corregida del trabajo a travs de la pgina web de la revista en el mismo espacio abierto para la versin inicial; no lo enve como un nuevo artculo. Para cualquier duda o aclaracin puede ponerse en contacto con la revista en revista...@uab.cat
No se aceptar ningn otro medio de envo ni se mantendr correspondencia sobre los originales no enviados a travs del portal o en otros formatos.

El texto de las aportaciones no debe tener indicio de su autora para asegurar una revisin ciega. Por este motivo, la identificacin solo se har en la primera pgina de la aportacin.
Los originales remitidos tendrn que seguir las aspectos formales indicados en el apartado 1.4 Aspecto Formal.

1.2 Ensayos
Los ensayos debern tener un carcter didctico, especialmente donde el autor expondr sus reflexiones sobre un tema. Se valorar el razonamiento cientfico, la imaginacin artstica y la creatividad para profundizar en la cuestin tratada. Ser fundamental la claridad expositiva que permita una fcil comprensin del pensamiento desarrollado en el escrito.
Los ensayos presentados debern tener entre 4 y 8 pginas de texto con los siguientes apartados: Introduccin (10%): Presentacin de aspectos relevantes del ensayo: su importancia, su influencia en el campo del diseo grfico; Desarrollo (80%). Exposicin de la perspectiva del autor sobre el tema y los elementos ms importantes del mismo. Se pueden utilizar las referencias que se consideren necesarias; y Conclusiones (10%). Expresin sinttica de lo fundamental expuesto en el ensayo.

d3342ee215
Reply all
Reply to author
Forward
0 new messages