[RQt-devel] scale of view for some primitive doesn't work
Michael Lawrence
lawrence.michael at gene.com
Sat Nov 13 14:28:19 CET 2010
On Fri, Nov 12, 2010 at 2:42 PM, Michael Lawrence <michafla at gene.com> wrote:
>
>
> On Fri, Nov 12, 2010 at 2:13 PM, Tengfei Yin <yintengfei at gmail.com> wrote:
>
>>
>>
>> On Fri, Nov 12, 2010 at 3:27 PM, Michael Lawrence <
>> lawrence.michael at gene.com> wrote:
>>
>>>
>>>
>>> On Fri, Nov 12, 2010 at 8:59 AM, Tengfei Yin <yintengfei at gmail.com>wrote:
>>>
>>>>
>>>>
>>>> On Fri, Nov 12, 2010 at 7:09 AM, Michael Lawrence <
>>>> lawrence.michael at gene.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Thu, Nov 11, 2010 at 9:35 PM, Tengfei Yin <yintengfei at gmail.com>wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Nov 11, 2010 at 10:27 PM, Michael Lawrence <
>>>>>> lawrence.michael at gene.com> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Nov 11, 2010 at 7:32 PM, Tengfei Yin <yintengfei at gmail.com>wrote:
>>>>>>>
>>>>>>>> So even when you use view$rotate(), the text direction won't
>>>>>>>> change..is this also what we expected to see?
>>>>>>>>
>>>>>>>>
>>>>>>> Yes. I can see how that may not always be desirable, but it would be
>>>>>>> tough to work around it. That is, I cannot tease out the rotation from the
>>>>>>> rest of the transformation. In the case of a word cloud, I think it would be
>>>>>>> desirable, i.e., one is thinking of the text as glyphs that are independent
>>>>>>> of the scales.
>>>>>>>
>>>>>>>
>>>>>>>> and by the way, do you know any way to change to text size, the use
>>>>>>>> case here is sth like "tag cloud", but I guess I can draw text as path to
>>>>>>>> solve this problem.
>>>>>>>>
>>>>>>>>
>>>>>>> Just change the font.. do you want some sort of vectorized "cex"
>>>>>>> argument to qdrawText? Might not be that hard to add.
>>>>>>>
>>>>>>
>>>>>> Yes, if you don't mind spend some time on it, it will be really nice
>>>>>> to have a control over the text size, e.g. when I plot a sequence data, like
>>>>>> ACTGGGC....I can resize one single character to address the mis-alignment.
>>>>>>
>>>>>
>>>>> You mean like a sequence logo plot, based on the counts of each base?
>>>>> Sweet idea. The feature is committed, have fun.
>>>>>
>>>>
>>>> Yes, I plan to do sth like this~the problem of this kind of graphic is
>>>> that, no problem showing as a single plot, but when showing along a
>>>> shot-read alighment, due to resale of all the text, even a single size
>>>> change of one base will make it hard to align a single sequence with other
>>>> "normal" text. I will work around this to see if I have some problem.
>>>>
>>>>
>>> Text glyphs could be scaled differently in the horizontal and vertical.
>>> Would this help with this issue? That is, you could stretch the letters
>>> vertically.
>>>
>>
>> Do you mean sth that is already in qtpaint?
>>
>
> No it's not there yet but it would be easy to support it. Right now 'cex'
> causes a symmetric scale; it does not need to be that way. I will add it.
>
>
I added support for this. Just specify the 'vcex' parameter instead of 'cex'
to expand only in the vertical direction.
>
>> it's not in qdrawText(), and the qglyphText has no such a parameter, do
>> you suggest me to create text as path and use qdrawPath to plot those
>> stuff?? and by the way, in the qt document,
>> void QFont::setStretch ( int factor )
>> only set width of character. How can I specify whether to stretch it
>> vertically or horizontally? Or do you mean doing sth like transformation?
>>
>>
>>> Btw: any idea where is globalPos(), I try to use tooltip associated
>>>> with locate() function to do this:when mouse over on exon, show the id, but
>>>> I can only find pos, based on the documentation, it looks like I need to get
>>>> globalPos..of course I have alternative workaround instead of using
>>>> QToolTip.
>>>>
>>>>
>>> I'm not sure I follow. Are you talking about globalPos() on the event
>>> object? That is global screen position, not even relative to the window, so
>>> you would need to be careful to adjust it.
>>>
>>
>> Yes, I can not find globalPos() on event object?
>>
>
> What about screenPos()?
>
>
>> and I think you are right, I guess I cannot use it. I am thinking that
>> maybe qdrawText will be faster than QToolTip, maybe tooltip is not used in
>> this purpose to show the exon names, maybe it's designed to show widget name
>> and function description.
>>
>>
> Well the tooltip window has various features, like hypertext. The user
> could click on something and launch a web browser to some external database,
> for example.
>
>
>> Thanks
>>
>>>
>>> Thanks
>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>> Michael
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Nov 11, 2010 at 6:14 PM, Tengfei Yin <yintengfei at gmail.com>wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Nov 11, 2010 at 5:39 PM, Michael Lawrence <
>>>>>>>>> lawrence.michael at gene.com> wrote:
>>>>>>>>>
>>>>>>>>>> This is by design. If this didn't work that way, then when the
>>>>>>>>>> user zoomed into a chromosome, for example, the text labels would get really
>>>>>>>>>> stretched out. Glyphs are the same way (they're essentially fancy
>>>>>>>>>> characters). Zooming into a scatterplot should not make the glyphs larger.
>>>>>>>>>> Circles (after much debate inside my head) behave the same as glyphs. This
>>>>>>>>>> is because their radius, like in a bubble plot, is derived from something
>>>>>>>>>> other than the X and Y axes.
>>>>>>>>>>
>>>>>>>>>> Shapes however, like rectangles, polygons and paths, are zoomed.
>>>>>>>>>> You expect a mosaic plot rectangle or a map polygon to scale with the plot.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> This make sense to me, in most cases, i guess people won't expect
>>>>>>>>> the circle or text to be zoomed in.
>>>>>>>>>
>>>>>>>>> Are you sure you really need the text to scale with the zoom?
>>>>>>>>>> Deepayan and I decided a long time ago that zooming does not behave like a
>>>>>>>>>> "magnifying glass." It rescales the plot.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> No, you don't have to change that, it's convenient so far, I am
>>>>>>>>> just curious why this doesn't work for text and circle, because in other
>>>>>>>>> rare case, I will draw very small text as labels of axis for one circular
>>>>>>>>> track, or if I draw points around the circular track, I am still expecting
>>>>>>>>> the points will be zoomed in when I rescale the view. I guess I am confused
>>>>>>>>> the "rescale of the view" with the one you defined with Deepayan, but it
>>>>>>>>> make sense to me.
>>>>>>>>>
>>>>>>>>> There are some ways to get around this if you really want to:
>>>>>>>>>> - Draw the text as a path.
>>>>>>>>>> - Use the "render" method on the scene to render to a QPicture,
>>>>>>>>>> rescale that and display it. This is how I imagined someone making a
>>>>>>>>>> magnifying glass. QPicture is a vectorized representation, so no nasty
>>>>>>>>>> scaling artifacts are introduced.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks, I think I need to do it in this way, if I really need them
>>>>>>>>> to be rescaled. I never try QPicture before, I will take a look at it.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Michael
>>>>>>>>>>
>>>>>>>>>> On Thu, Nov 11, 2010 at 3:24 PM, Tengfei Yin <
>>>>>>>>>> yintengfei at gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> Here comes another question with text, please see the attached
>>>>>>>>>>> code below, only rect could be resized, when I call v$scale()
>>>>>>>>>>>
>>>>>>>>>>> text, circle doesn't change. it happens to visnab, the circular
>>>>>>>>>>> view, when I scale the view, every thing resize but the text, it's still in
>>>>>>>>>>> the same size.
>>>>>>>>>>>
>>>>>>>>>>> library(qtpaint)
>>>>>>>>>>> s <- qscene()
>>>>>>>>>>> test_layer <- qlayer(s,function(layer,painter){
>>>>>>>>>>> qdrawRect(painter,30,30,70,70,stroke="blue")
>>>>>>>>>>> qdrawCircle(painter,50,50,20,stroke="red")
>>>>>>>>>>> qdrawText(painter,"TEST",50,50)
>>>>>>>>>>> },limits=qrect(0,0,100,100))
>>>>>>>>>>> v <- qplotView(s)
>>>>>>>>>>> v$show()
>>>>>>>>>>>
>>>>>>>>>>> v$scale(1.5,1.5)
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>>
>>>>>>>>>>> Tengfei
>>>>>>>>>>> --
>>>>>>>>>>> Tengfei Yin
>>>>>>>>>>> MCDB PhD student
>>>>>>>>>>> 1620 Howe Hall, 2274,
>>>>>>>>>>> Iowa State University
>>>>>>>>>>> Ames, IA,50011-2274
>>>>>>>>>>> Homepage: www.tengfei.name
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Qtinterfaces-devel mailing list
>>>>>>>>>>> Qtinterfaces-devel at lists.r-forge.r-project.org
>>>>>>>>>>>
>>>>>>>>>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Tengfei Yin
>>>>>>>>> MCDB PhD student
>>>>>>>>> 1620 Howe Hall, 2274,
>>>>>>>>> Iowa State University
>>>>>>>>> Ames, IA,50011-2274
>>>>>>>>> Homepage: www.tengfei.name
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Tengfei Yin
>>>>>>>> MCDB PhD student
>>>>>>>> 1620 Howe Hall, 2274,
>>>>>>>> Iowa State University
>>>>>>>> Ames, IA,50011-2274
>>>>>>>> Homepage: www.tengfei.name
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Qtinterfaces-devel mailing list
>>>>>>>> Qtinterfaces-devel at lists.r-forge.r-project.org
>>>>>>>>
>>>>>>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Tengfei Yin
>>>>>> MCDB PhD student
>>>>>> 1620 Howe Hall, 2274,
>>>>>> Iowa State University
>>>>>> Ames, IA,50011-2274
>>>>>> Homepage: www.tengfei.name
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Tengfei Yin
>>>> MCDB PhD student
>>>> 1620 Howe Hall, 2274,
>>>> Iowa State University
>>>> Ames, IA,50011-2274
>>>> Homepage: www.tengfei.name
>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Tengfei Yin
>> MCDB PhD student
>> 1620 Howe Hall, 2274,
>> Iowa State University
>> Ames, IA,50011-2274
>> Homepage: www.tengfei.name
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20101113/153cb9ff/attachment-0001.htm>
More information about the Qtinterfaces-devel
mailing list