[GRASS-dev] [GRASS GIS] #2077: implement drop-down menu for barscale styles

#2077: implement drop-down menu for barscale styles
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: unspecified
Keywords: d.barscale | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------
Would be nice to implement drop-down menu for barscale styles (1), ie.
`d.barscale style=` and probably also for `d.barscale north_arrow=`
similarly to `d.vect symbol=`.

(1) http://grasswiki.osgeo.org/wiki/Cartography#Display_monitors

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: d.barscale | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------
Changes (by hamish):

  * version: unspecified => svn-trunk

Comment:

Hi,

yes, I think that would be helpful as it's a bit difficult to find
specific names for all of the different styles, and of course being locked
into English those names in the current drop down list are not so helpful
when using GRASS translated. (fwiw, also I've been trying to keep them all
starting with a unique letter)

for the north arrows I didn't even try to describe them in a single word.
those already have png icon versions for `d.vect symbol=`, but probably
better to have a second set for this at ~ 75-100px square. see Anna's
/trunk/gui/images/symbols/README for standardized thumbnail creation
instructions.

thanks,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2077#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: d.barscale | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------

Comment(by annakrat):

Just to make it clear, do you want to create the images once and keep it
in the repository or generate it during compilation (like color tables)?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2077#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: d.barscale | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------

Comment(by hamish):

Replying to [comment:2 annakrat]:
> Just to make it clear, do you want to create the images once and keep it
in
> the repository or generate it during compilation (like color tables)?

Hi Anna,

I don't see any benefit to rebuild every time, happy to create them once
and then update manually in svn as needed. I don't expect to update them
often.

thanks,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2077#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: d.barscale | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------

Comment(by annakrat):

Done in r57698. I am not sure about the north arrows, I used the PNGs
which are already there for symbols, but they look little differently than
the arrow created by d.barscale (fill color is gray, not black, and the
'N' is not there).

Feel free to put the barscale pictures in a separate directory, I just
didn't want to spend time with the Makefile. Also, it would be nice to put
the images in the manual page like r.colors color tables.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2077#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: d.barscale | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------

Comment(by martinl):

Replying to [comment:4 annakrat]:
> Done in r57698. I am not sure about the north arrows, I used the PNGs
which are already there for symbols, but they look little differently than
the arrow created by d.barscale (fill color is gray, not black, and the
'N' is not there).

good work!

Unfortunately the patch has probably one side-effect. After this change
some widgets are not visible, see attachment:d-barscale.png

{{{
Python 2.7.5+ (default, Aug 4 2013, 10:07:17)
>>> wx.__version__
'2.8.12.1'
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2077#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: d.barscale | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------

Comment(by annakrat):

It should be fixed in r57701 (wrong if condition), thanks for noticing it.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2077#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: fixed | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by martinl):

  * status: new => closed
  * resolution: => fixed

Comment:

Replying to [comment:6 annakrat]:
> It should be fixed in r57701 (wrong if condition), thanks for noticing
it.

Confirmed. Thanks for quick fix!

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2077#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: fixed | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by martinl):

Small note: generated images of barscale are currently stored in
source:grass/trunk/gui/images. Better place would be `gui/images/barscale`
or something similar.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by martinl):

  * status: closed => reopened
  * resolution: fixed =>

Comment:

BTW, any chance to add barscale images to the manual, similarly to
`r.colors`?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by martinl):

Another issue, after splitting out the module to `d.barscale` and
`d.northarrow`, the dialog of `d.northarrow` lacks generated images of the
styles.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by annakrat):

Replying to [comment:9 martinl]:
> BTW, any chance to add barscale images to the manual, similarly to
`r.colors`?

This issue and the one with barscale directory is already in comment 5. I
am leaving this to others (because of Makefiles).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by annakrat):

Replying to [comment:10 martinl]:
> Another issue, after splitting out the module to `d.barscale` and
`d.northarrow`, the dialog of `d.northarrow` lacks generated images of the
styles.

I will try to look at it today or later together with the other issues
(#2080)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by martinl):

Replying to [comment:11 annakrat]:
> Replying to [comment:9 martinl]:
> > BTW, any chance to add barscale images to the manual, similarly to
`r.colors`?
>
>
> This issue and the one with barscale directory is already in comment 5.
I am leaving this to others (because of Makefiles).

Ah, I overlooked. I will take a look.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by martinl):

Replying to [comment:11 annakrat]:
> Replying to [comment:9 martinl]:
> > BTW, any chance to add barscale images to the manual, similarly to
`r.colors`?
>
>
> This issue and the one with barscale directory is already in comment 5.
I am leaving this to others (because of Makefiles).

done in r57729.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by martinl):

Replying to [comment:9 martinl]:
> BTW, any chance to add barscale images to the manual, similarly to
`r.colors`?

Done in r57735.

I am not sure about current solution, barscale previews are copied to
`$(DIST)/gui/images` directory which seems to be a natural place for them.
Previews in the manual link to this directory which is probably not a good
idea. GRASS installation could be distributed without GUI, then the
previews will be missing in the manual. We have two options

  (1) redundancy - copy barscales previews to two directories, ie.
`gui/images` and `docs/html`. Already used for toolbar icons.

  (2) copy barscales only to `docs\html`

Second option could be problem for distributions without documentation,
then the previews would be missing. But it's quite improbable situation.

BTW, colorstable previews are currently copied only to `docs/html`.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by wenzeslaus):

The GUI should depend on documentation not the other way around, so 2 or 1
are the right options.

Do we know that documentation is always in `$GISBASE/docs/html` on all
platforms? Are there any distributions which put the documentation
somewhere else? The first option (redundancy) would be the safest option
in this case.

Currently, the documentation path in the GUI is used for accessing the
pages, e.g. in module dialogs/forms. So, the option 2 (things in
docs/html) is already used and it seems to work. (But are we sure that it
is always `$GISBASE/docs/html`?)

By the way, I'm wondering how the compilation of HTML works in non-unix
enviroments. Do I need to have `sed` installed?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by martinl):

Replying to [comment:16 wenzeslaus]:
> The GUI should depend on documentation not the other way around, so 2 or
1 are the right options.

Agreed, I would suggest to move barscale thumbs to `display/d.barscale`
and copy them to `$GISBASE/docs/html` (similarly to `r.colors`'s color
tables).

> Do we know that documentation is always in `$GISBASE/docs/html` on all
platforms? Are there any distributions which put the documentation
somewhere else? The first option (redundancy) would be the safest option
in this case.

Not sure about that.

> Currently, the documentation path in the GUI is used for accessing the
pages, e.g. in module dialogs/forms. So, the option 2 (things in
docs/html) is already used and it seems to work. (But are we sure that it
is always `$GISBASE/docs/html`?)
>
> By the way, I'm wondering how the compilation of HTML works in non-unix
enviroments. Do I need to have `sed` installed?

AFAIK, `sed` is required.

{{{
grep -w 'sed' --include=Makefile -R | cut -d':' -f1 | uniq
macosx/app/Makefile
macosx/Makefile
raster/r.colors/Makefile
lib/python/script/Makefile
lib/python/ctypes/Makefile
lib/init/Makefile
mswindows/Makefile
include/Makefile
demolocation/Makefile
vector/v.colors/Makefile
display/d.barscale/Makefile
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by martinl):

Replying to [comment:17 martinl]:
> Replying to [comment:16 wenzeslaus]:
> > The GUI should depend on documentation not the other way around, so 2
or 1 are the right options.
>
> Agreed, I would suggest to move barscale thumbs to `display/d.barscale`
and copy them to `$GISBASE/docs/html` (similarly to `r.colors`'s color
tables).

done in r57801. Similarly we could include symbols thumbnails in d.vect's
manual page and probably move `gui/images/symbols` to
`display/d.vect/symbols` (?)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#2077: implement drop-down menu for barscale styles
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: d.barscale
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------

Comment(by hamish):

Replying to [comment:18 martinl]:
> Similarly we could include symbols thumbnails in d.vect's manual
> page and probably move `gui/images/symbols` to `display/d.vect/symbols`
(?)

not for symbols because symbols are independent of d.vect (e.g. d.graph,
ps.map), whereas d.barscale contains the code to render the barscale
internally.

for the color scales r.colors makes them as part of its Makefile, so it
makes some sense for them to be built into raster/r.colors/ then installed
from there.

Don't worry about prepping things for the debian/ubuntu packaging, it's
all manually picked into the various packages by hand & 'make install' is
not run there. A goal of the packaging is to keep platform dependent code
(e.g. exe binaries) and platform independent code (e.g. help pages, png
images) in separate packages so the platform-independent files can be
shared across all, and only the platform-specific files need to be
duplicated on the download servers. (etc/ is a bit of a tricky one to
untangle, since it has both in the same dir structure and while hand
picked, it's easier to do/maintain that by dir than by file)

Having said that, I don't think it's a big deal if the help pages have
broken links to the thumbnails if the grass-gui package is not installed,
it's more important that the drop-down menus work. Duplication is not
good, but I can see the case where the docs should be self-contained in
html/ dir (+subdirs). Similarly, I can see the case that the GUI shouldn't
have to hunt in $GISBASE/etc/docs/ for support files, but I guess anything
in etc/ is fair game. These files are pretty tiny anyway..

> AFAIK, sed is required.

note that 'sed' is ok, but 'sed -i' is not portable to Mac/BSD.

thanks,
Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2077#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>