Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


3 Pages<123>
Options
Go to last post Go to first unread
Offline uni  
#21 Posted : 12 October 2013 17:49:50(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: mkraska Go to Quoted Post
Still there is another, more important issue: could you please interpret relative paths with respect to the directory of the current SMath document instead of the current directory? This would create portable documents and enable putting examples in the activebook help system.

I can't do that. More precisely, I don't know how to do it, because SMath Studio does not provide such information. That's why I added CurrentDirectory() function. There is another way to change the current folder. Open the document and then save it via the Save As option. In this case, SMath Studio will change the current path. The path must be changed when the file is opened, but it doesn't. You have to ask Andrey to implement this feature.
Russia ☭ forever
Viacheslav N. Mezentsev
Offline mkraska  
#22 Posted : 12 October 2013 18:25:11(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
I don't know, how Davide managed to do this, but the DataExchange plugin somehow manages to handle relative paths with respect to the current document (despite the help text mentioning the current dir as default path).

In the attached screen shot you see a document, where a formula is exported using a relative path. The file is created in the directory of the currently open SMath document, even if that is not the current system directory (as can be seen in the CurrentDirectory() output).

May be the approach is not available for custom regions. Then a separate function like "DocumentDirectory()" would help, just as the function "SettingsDirectory()" from CustomFunctions, which is used to build the hyperlink targets in the activebook plugin index.
mkraska attached the following image(s):
dir.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 12/10/2013(UTC)
Offline uni  
#23 Posted : 12 October 2013 19:37:25(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. Thank you, Martin. I have looked how he does it. SMath Studio explicitly transmits information about the path of the currently opened document (store.FileName), but it is available only at the time of its evaluation.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 12/10/2013(UTC)
Offline mkraska  
#24 Posted : 12 October 2013 19:51:59(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: uni Go to Quoted Post
... but it is available only at the time of its evaluation.

Great, thanks. Seems to work. However, I do not understand what limitation is implied by your statement.

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline mkraska  
#25 Posted : 13 October 2013 00:32:48(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Would it be possible to size the region according to the image size? Perhaps as an option.

I'd also propose to provide sort of image scaling and clipping, with mouse interaction consistent to the xy plot region, i.e.
- zoom by mouse wheel
- move by dragging the image
- resize by dragging the boundary resizing markers
- double click to reset to default (according to feature request above)
This might be sensible only for display of images from files.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#26 Posted : 13 October 2013 07:50:24(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: mkraska Go to Quoted Post
Originally Posted by: uni Go to Quoted Post
... but it is available only at the time of its evaluation.

Great, thanks. Seems to work. However, I do not understand what limitation is implied by your statement.

This was remark for developers.

Originally Posted by: mkraska Go to Quoted Post
Would it be possible to size the region according to the image size? Perhaps as an option.

I'd also propose to provide sort of image scaling and clipping, with mouse interaction consistent to the xy plot region, i.e.
- zoom by mouse wheel
- move by dragging the image
- resize by dragging the boundary resizing markers
- double click to reset to default (according to feature request above)
This might be sensible only for display of images from files.

Ok, I'll think about it too. As for svg images, you can change the size of this type of images, but only if the dimensions are not specified in the file. Try these svg-files.

Edited by user 13 October 2013 07:53:55(UTC)  | Reason: Not specified

File Attachment(s):
svg.zip (6kb) downloaded 50 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 13/10/2013(UTC)
Offline omorr  
#27 Posted : 13 October 2013 10:14:46(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
I tried your svg pictures uni. You are right, they can be resized but keeping their aspect ratio.
I suppose there is not a way to respect their aspect ratio by dragging the resizing either of the dragging markers (just asking). Actually, we can make it fit - if we want - by dragging the individual markers separately.

Regards,
Radovan
omorr attached the following image(s):
svgimages.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#28 Posted : 13 October 2013 12:51:21(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: uni Go to Quoted Post
As for svg images, you can change the size of this type of images, but only if the dimensions are not specified in the file.

Thanks, this works. In my example, I just had to removing this: width="65.29mm" height="52.71mm"
mkraska attached the following image(s):
svg.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Davide Carpi  
#29 Posted : 13 October 2013 15:22:58(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: uni Go to Quoted Post
Updated. Added support for svg.



Great feature, thank you Viacheslav OK

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline PompelmoTell  
#30 Posted : 14 October 2013 17:48:24(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 319
Man
Italy
Location: italy

Was thanked: 109 time(s) in 93 post(s)

I tried the method suggested by Martin, It works fine with Jpgfdraw files (save as SVG) but not with Inkscape file (save as SVG or Pure SVG)
sergio
Offline mkraska  
#31 Posted : 25 January 2014 15:58:21(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Is it possible, to evaluate the expression in the placeholder of the image region?

Then we would have a neat way to display Maxima generated images using the Draw2D() and Draw3D() functions as described here.

These functions return the file name of the generated image.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline mkraska  
#32 Posted : 05 February 2014 16:11:13(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
There is an svg rendering problem in the image region. The attached file displays differently in TpX, IE and SMath/Image region. Look at the rightmost line in the diagrams. The only correct rendering is by TpX. Of course, I cannot guarantee that gnuplot produces correct svg code. The gnuplot input files produced by Maxima are correct.
File Attachment(s):
Diffusion.sm (31kb) downloaded 40 time(s).
diffusion.zip (2kb) downloaded 39 time(s).
gnuplot_input.zip (2kb) downloaded 39 time(s).
mkraska attached the following image(s):
diffusion.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline omorr  
#33 Posted : 05 February 2014 18:01:06(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Martin,

Hmm...I might missed something, but I can not see the plots in the SMath "Diffusion.sm" file. I expected to see them (as usual) but the regions are empty and the *.svg files are not in the active directory (dir variable). See the picture and the log file please.

Regards,
Radovan

EDIT: Strange Shok , I managed somehow to get those bargraphs - right bars were decreseing ( by moveing dir:= ). On the third one I saw th problem at the end - but can not reproduce anymore. Still empty regions???
EDIT2: It seems that Maxima restart and few recalculations will bring the plots (second picture)

Edited by user 05 February 2014 18:36:53(UTC)  | Reason: Not specified

File Attachment(s):
Maxima.zip (4kb) downloaded 34 time(s).
omorr attached the following image(s):
Diffusion.png
Diffusion-1.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline uni  
#34 Posted : 05 February 2014 19:05:53(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. SMath Studio 0.96.5146 required.

h0.01 - if you remove this then you'll get the right result.

Code:
<g style="fill:none; color:red; stroke:currentColor; stroke-width:8.00; stroke-linecap:butt; stroke-linejoin:miter">
	<path stroke='rgb(  0,   0, 255)'  d='M41.9,126.0 L41.9,24.5 M54.4,126.0 L54.4,24.7 M66.8,126.0 L66.8,25.0 M79.3,126.0 L79.3,25.5 
		M91.7,126.0 L91.7,26.2 M104.2,126.0 L104.2,27.1 M116.6,126.0 L116.6,28.1 M129.1,126.0 L129.1,29.4 
		M141.5,126.0 L141.5,31.0 M154.0,126.0 L154.0,32.7 M166.4,126.0 L166.4,34.7 M178.8,126.0 L178.8,37.0 
		M191.3,126.0 L191.3,39.5 M203.7,126.0 L203.7,42.3 M216.2,126.0 L216.2,45.3 M228.6,126.0 L228.6,48.5 
		M241.1,126.0 L241.1,52.0 M253.5,126.0 L253.5,55.7 M266.0,126.0 L266.0,59.5 M278.4,126.0 L278.4,63.5 
		M290.9,126.0 L290.9,67.6 M303.3,126.0 L303.3,71.7 M315.8,126.0 L315.8,75.8 M328.2,126.0 L328.2,80.0 
		M340.7,126.0 L340.7,84.1 M353.1,126.0 L353.1,88.0 M365.6,126.0 L365.6,91.9 M378.0,126.0 L378.0,95.5 
		M390.5,126.0 L390.5,99.0 M402.9,126.0 L402.9,102.3 M415.4,126.0 L415.4,105.3 M427.8,126.0 L427.8,108.0 
		M440.3,126.0 L440.3,110.6 M452.7,126.0 L452.7,112.8 M465.1,126.0 L465.1,114.8 M477.6,126.0 L477.6,116.6 
		M490.0,126.0 L490.0,118.1 M502.5,126.0 L502.5,119.4 M514.9,126.0 L514.9,120.5 M527.4,126.0 L527.4,121.4 
		M539.8,126.0 L539.8,122.0 M552.3,126.0 L552.3,122.6 M564.7,126.0 L564.7,122.9 M577.2,126.0 L577.2,123.0 
		 '/></g>


P.S. Now the background is not removed.

Edited by user 05 February 2014 19:18:24(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 05/02/2014(UTC)
Offline mkraska  
#35 Posted : 05 February 2014 19:28:18(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
There might be some issues which I did not yet mention.

1. this all applies to SMath 0.96.4909, as the image region is (was) not yet available for the new build (updated Maxima is available on SVN, but still in testing)
2. There might be a timing/robustness issue, it is a bit risky to use identical file names for different plots in the sheet. I changed the sheet such that you get different file names. The images should be produced upon opening or recalculating the sheet.

@uni: Thanks for the update. I confirm that removing h0.01 from wherever in the svg file mitigates the problem (in the old and in the new ImageRegion version). What does h0.01 say? Perhaps that can be avoided by particular plot settings? Just like with the scaling, where it proved possible to get scalable svgs without regexping the svg file.
Another question: Is that a gnuplot bug which I should report there or is this a problem of the image region (and of the IE)?

Edited by user 05 February 2014 19:33:00(UTC)  | Reason: Not specified

File Attachment(s):
Diffusion.sm (31kb) downloaded 32 time(s).
mkraska attached the following image(s):
diffusion.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#36 Posted : 05 February 2014 19:45:18(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Quote:
What does h0.01 say?


8.3.4 The "lineto" commands

Perhaps this is a bug in the SharpVectors library that I use.
Russia ☭ forever
Viacheslav N. Mezentsev
Offline mkraska  
#37 Posted : 05 February 2014 20:06:15(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: uni Go to Quoted Post
Perhaps this is a bug in the SharpVectors library that I use.


I do not know why gnuplot draws a very short horizontal line at the top of the last blue vertical bar. This might be a bug but should essentially be invisible with butt line ends.
The IE rendering and the image region show this horizontal line much too long.
On top of this, the image region somehow wrongly joines the horizontal and the vertical line.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#38 Posted : 05 February 2014 20:33:05(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
I asked a question on the support forum: Is this a bug?
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 05/02/2014(UTC)
Offline Davide Carpi  
#39 Posted : 05 February 2014 21:45:29(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: mkraska Go to Quoted Post
Another question: Is that a gnuplot bug which I should report there or is this a problem of the image region (and of the IE)?

I've noticed the same issues both in chrome and firefox... so, is a bug in the image or in all the major browers Tongue

Edited by user 05 February 2014 21:52:54(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline mkraska  
#40 Posted : 06 February 2014 00:22:32(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Here is my post to a gnuplot forum.

EDIT: and here is the response, saying that the horizontal line was a fix for viewer problems in the past but should not be visible. There is no fast way to fix the problem.


There are some posts in the group, saying that most viewers render svg wrongly, but that would be no reason to modify the svg export, as it is the fault of the viewers.



Alternativly, Maxima/Gnuplot could export eps or pdf. Uni, if you can display that in a scalable way, then I could possibly switch to that terminal. I attached two corresponding files (had to zip the eps, because such attachments are not allowed in the forum)

Edited by user 06 February 2014 03:37:05(UTC)  | Reason: Not specified

File Attachment(s):
mypdf.pdf (7kb) downloaded 57 time(s).
myfile.zip (5kb) downloaded 38 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Users browsing this topic
Guest
Similar Topics
Image Region [size/scroll] (Samples)
by Jean Giraud 09/06/2023 16:43:22(UTC)
Image Region Plugin - unable to install in SS 7813 (Bugs & Problems)
by ndtma 25/05/2021 20:17:53(UTC)
IMAGE REGION DOESN´T WORK (Bugs & Problems)
by Leandro Martins 10/04/2021 02:22:13(UTC)
[Image Region] Not woring on Windows 10 Laptop (Bugs & Problems)
by shiju 28/04/2017 22:08:04(UTC)
Image Region Does Not Reset (Bugs & Problems)
by Jean Giraud 18/04/2017 17:34:04(UTC)
[Image Region] 6179 SMath.Studio Errors & Glitches (Bugs & Problems)
by Novice 31/01/2017 16:59:12(UTC)
Editable Image Region - Plugin Update (Extensions)
by Alex M. 14/02/2016 09:46:23(UTC)
Editable Image Region (Extensions)
by mkraska 03/05/2014 13:47:12(UTC)
3 Pages<123>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.