Re: [web2py] Re: Graph Model (proposal to contribute)

2017-02-28 Thread Andrew Willimott
Hi Donald,  yes I have , and I have been meaning to some changes (to minimise 
the overlap in names).Sorry, been busy lately, I'll get on to updating 
Welcome.  My plan is to leave the existing graph code as is until everyone is 
ok with it.  Thanks for following up.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2017-02-27 Thread Donald McClymont
Has anyone had a chance to try this out and advise if it is suitable to 
incorporate in main web2py or if there are some other changes that should 
be made before it would be acceptable.  There's lots more that could be 
done with it but it seems quite useful and usable in present form?

Donald

On Sunday, November 20, 2016 at 5:33:54 PM UTC, Andrew Willimott wrote:
>
> Thanks Donald,  I'll do another round of improvements and then create a 
> PR.  it does need to handle larger models better and I'll improve  the code 
> layout too.  I'm also learning the d4 differences and there are a lot of 
> future options with using d3.
>
>  web2py with a d3 interactive front end is a good topic.  Interested to 
>  know more as I'm working on this too.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-20 Thread Andrew Willimott
Thanks Donald,  I'll do another round of improvements and then create a PR.  it 
does need to handle larger models better and I'll improve  the code layout too. 
 I'm also learning the d4 differences and there are a lot of future options 
with using d3.

 web2py with a d3 interactive front end is a good topic.  Interested to  know 
more as I'm working on this too.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-19 Thread Donald McClymont
Had a look at this and seems far better way to go as pygraphviz was beyond 
me to install on windows.  I've been using d3 for some other things with 
web2py and some degree of interactivity with the graph eg creating new 
nodes and saving the layout as force directed typically gives you a good 
starting point but some further manual organisation can help.  It also does 
seem as suspected some tweaking will be required for larger data models as 
some of it doesn't appear to show properly on my test.  I am currently 
working on moving my stuff to d3 v4 which was proving challenging on the 
interactive graph as I am no expert on d3.  I am hoping this example will 
help with that and I will see if I can come back with some improvements to 
this as well.

Regards
Donald

On Thursday, November 17, 2016 at 1:49:55 PM UTC, JorgeH wrote:
>
> +1 for D3 here

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-17 Thread JorgeH
+1 for D3 here

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-16 Thread Ron Chatterjee
+1.

 Is it going to be standard on next upgrades?


On Wednesday, November 16, 2016 at 9:58:35 AM UTC-5, Ramos wrote:
>
> +1 for D3
> no need to install graphviz and pygraphviz on the server...
>
>
> 2016-11-16 13:56 GMT+00:00 Richard Vézina  >:
>
>> Could we keep both rendering mechanism graphviz + d3?
>>
>> On Wed, Nov 16, 2016 at 4:38 AM, Andrew Willimott > > wrote:
>>
>>> Here's a start:
>>> https://github.com/willimoa/welcome_d3
>>>
>>>
>>>
>>>
 -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-16 Thread António Ramos
+1 for D3
no need to install graphviz and pygraphviz on the server...


2016-11-16 13:56 GMT+00:00 Richard Vézina :

> Could we keep both rendering mechanism graphviz + d3?
>
> On Wed, Nov 16, 2016 at 4:38 AM, Andrew Willimott 
> wrote:
>
>> Here's a start:
>> https://github.com/willimoa/welcome_d3
>>
>>
>>
>>
>>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-16 Thread Richard Vézina
Could we keep both rendering mechanism graphviz + d3?

On Wed, Nov 16, 2016 at 4:38 AM, Andrew Willimott 
wrote:

> Here's a start:
> https://github.com/willimoa/welcome_d3
>
>
>
>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-16 Thread Andrew Willimott
Here's a start:
https://github.com/willimoa/welcome_d3




>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-07 Thread António Ramos
+1 for D3js..

2016-11-06 19:45 GMT+00:00 Jurgis Pralgauskis 
:

> Hi, I would be interested!
>
> Ps.: I made some subgraph/filtering features, when graph model is big
> (hundreds of tables), but with JS it might work nicer..
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-06 Thread Jurgis Pralgauskis
Hi, I would be interested!

Ps.: I made some subgraph/filtering features, when graph model is big (hundreds 
of tables), but with JS it might work nicer..

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2016-10-24 Thread Andrew Willimott


Has anyone else tried visualising the models with d3js ?  I have a mockup 
working using the force layout.  I'd suggest this is a better long term 
approach than relying on graphviz being installed.  (Graphviz has some good 
layouts though).

I can send cleaned up code as a candidate to add to Welcome.  





On Tuesday, February 19, 2013 at 4:33:41 AM UTC+13, Ramos wrote:
>
> D3js pure javascript on client!
>
> see this example of meteorjs using d3js
>
> http://meteor.com/examples/parties
>
> That is something...
>
>
>
> 2013/2/18 Niphlod >
>
>> the only issue with the current implementation in trunk is that on 
>> Windows it's almost impossible to get it going, due to the requirements.
>>
>>
>> -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Graph Model (proposal to contribute)

2013-02-18 Thread António Ramos
D3js pure javascript on client!

see this example of meteorjs using d3js

http://meteor.com/examples/parties

That is something...



2013/2/18 Niphlod 

> the only issue with the current implementation in trunk is that on Windows
> it's almost impossible to get it going, due to the requirements.
>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-29 Thread Jose
dia can load svg files!

Jose

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-29 Thread Jose


El sábado, 29 de diciembre de 2012 21:22:47 UTC-3, rochacbruno escribió:
>
>
>
> On Sat, Dec 29, 2012 at 10:20 PM, Jose >wrote:
>
>> ‘dia’
>
>
> It exports on to an editable dia diagram?
>
> I have to test it! 
>

>From http://networkx.lanl.gov/pygraphviz/preview/reference/agraph.html

 Formats (not all may be available on every system depending on how 
Graphviz was built)

‘canon’, ‘cmap’, ‘cmapx’, ‘cmapx_np’, ‘dia’, ‘dot’, ‘fig’, ‘gd’, ‘gd2’, 
‘gif’, ‘hpgl’, ‘imap’, ‘imap_np’, ‘ismap’, ‘jpe’, ‘jpeg’, ‘jpg’, ‘mif’, 
‘mp’, ‘pcl’, ‘pdf’, ‘pic’, ‘plain’, ‘plain-ext’, ‘png’, ‘ps’, ‘ps2’, ‘svg’, 
‘svgz’, ‘vml’, ‘vmlz’, ‘vrml’, ‘vtx’, ‘wbmp’, ‘xdot’, ‘xlib’


In my system I have not compiled graphviz with support for day.

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-29 Thread Bruno Rocha
On Sat, Dec 29, 2012 at 10:20 PM, Jose  wrote:

> ‘dia’


It exports on to an editable dia diagram?

I have to test it!

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-29 Thread Jose
I like different colors to gray...

You can add more formats to download:

‘canon’, ‘cmap’, ‘cmapx’, ‘cmapx_np’, ‘dia’, ‘dot’, ‘fig’, ‘gd’, ‘gd2’, 
‘gif’, ‘hpgl’, ‘imap’, ‘imap_np’, ‘ismap’, ‘jpe’, ‘jpeg’, ‘jpg’, ‘mif’, 
‘mp’, ‘pcl’, ‘pdf’, ‘pic’, ‘plain’, ‘plain-ext’, ‘png’, ‘ps’, ‘ps2’, ‘svg’, 
‘svgz’, ‘vml’, ‘vmlz’, ‘vrml’, ‘vtx’, ‘wbmp’, ‘xdot’, ‘xlib’

José

-- 



--- /home/jose/web2py/applications/welcome/views/appadmin.html	2012-12-25 12:11:39.0 -0300
+++ /home/jose/web2py/applications/borro3/views/appadmin.html	2012-12-29 20:48:18.0 -0300
@@ -229,7 +229,21 @@
 {{=T('pygraphviz library not found')}}
   {{elif not databases:}}
 {{=T("No databases in this application")}}
-  {{else:}}
+  {{else:}}	   
+
+  
+ {{=T('Save model as...')}}
+
+  
+  
+  png
+  svg
+  pdf
+  ps
+  dot   
+  
+
+
 {{=IMG(_src=URL('appadmin', 'bg_graph_model'))}}
   {{pass}}
 {{pass}}
--- /home/jose/web2py/applications/welcome/controllers/appadmin.py	2012-12-29 10:33:02.0 -0300
+++ /home/jose/web2py/applications/borro3/controllers/appadmin.py	2012-12-29 21:11:28.0 -0300
@@ -487,18 +487,27 @@
 else:
 return ' '
 
-# This is horribe HTML but the only one graphiz understands
+# This is horribe HTML but the only one graphviz understands
 rows = []
-cellpadding = 4
-color = "#00"
-bgcolor = "#FF"
+cellpadding = 4
 face = "Helvetica"
 face_bold = "Helvetica Bold"
 border = 0
 
-rows.append(TR(TD(FONT(table, _face=face_bold, _color=bgcolor),
+if table.startswith('auth_'):
+header_color = "#FF"
+header_bgcolor = "#00"
+color = "#00"
+bgcolor = "#FF"
+else:
+header_color = "#FF"
+header_bgcolor = "#717171"
+color = "#00"
+bgcolor = "#FBFBFB"
+
+rows.append(TR(TD(FONT(table, _face=face_bold, _color=header_color),
_colspan=3, _cellpadding=cellpadding,
-   _align="center", _bgcolor=color)))
+   _align="center", _bgcolor=header_bgcolor)))
 for row in db[table]:
 rows.append(TR(TD(FONT(row.name, _color=color, _face=face_bold),
   _align="left", _cellpadding=cellpadding,
@@ -532,7 +541,16 @@
 graph.add_edge(n1, n2, color="#4C4C4C", label='')
 
 graph.layout()
-return graph.draw(format='png', prog='dot')
+if not request.args:
+return graph.draw(format='png', prog='dot')
+else:   
+response.headers['Content-Disposition']='attachment;filename=graph.%s'%request.args(0)
+if request.args(0) == 'dot':
+return graph.string()
+else:
+return graph.draw(format=request.args(0), prog='dot')
+
 
 def graph_model():
-return dict(databases=databases, pgv=pgv)
+file_type = SELECT('png', 'svg', 'dot')
+return dict(databases=databases, pgv=pgv, file_type=file_type)


Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-29 Thread Massimo Di Pierro
I'll take the patch. ;-)
Please use colors which look when printed in black and white.

On Saturday, 29 December 2012 07:53:17 UTC-6, Jose wrote:
>
> This can be useful?
>
> 1) Save the model
> 2) Show auth_ tables different from other
>
> If you want to send the patch.
> Jose
>
>

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-28 Thread António Ramos
D3js seems Awsome. Its already included in Meteorjs

http://www.dashingd3js.com/table-of-contents
http://bost.ocks.org/mike/d3/workshop/




2012/12/28 Alan Etkin 

> > El viernes, 28 de diciembre de 2012 15:34:49 UTC-3, Ramos escribió:D3js
>
> I'm looking at the awsome examples of D3.js at http://d3js.org/
>
> The thing is that I can't find anything pre-built to show a relational
> database scheme as graphviz does.
>
> --
>
>
>
>

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-28 Thread Alan Etkin
> El viernes, 28 de diciembre de 2012 15:34:49 UTC-3, Ramos escribió:D3js

I'm looking at the awsome examples of D3.js at http://d3js.org/

The thing is that I can't find anything pre-built to show a relational 
database scheme as graphviz does.

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-28 Thread Massimo Di Pierro
I would very much prefer if the graph were generated in JS instead of using 
serverside code.

On Friday, 28 December 2012 12:34:49 UTC-6, Ramos wrote:
>
> D3js
>
> 2012/12/28 Alan Etkin >
>
>> Too bad graphviz does not accept css (and  the "<  >" is weird 
>> also). I wonder if there is any alternative library with similar 
>> functionality. Maybe something to produce an svg visual model with a simple 
>> API. Am I asking too much?
>>
>>  -- 
>>  
>>  
>>  
>>
>
>

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-28 Thread António Ramos
D3js

2012/12/28 Alan Etkin 

> Too bad graphviz does not accept css (and  the "<  >" is weird
> also). I wonder if there is any alternative library with similar
> functionality. Maybe something to produce an svg visual model with a simple
> API. Am I asking too much?
>
>  --
>
>
>
>

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-28 Thread Alan Etkin
Too bad graphviz does not accept css (and  the "<  >" is weird 
also). I wonder if there is any alternative library with similar 
functionality. Maybe something to produce an svg visual model with a simple 
API. Am I asking too much?

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-26 Thread Jose


El miércoles, 26 de diciembre de 2012 09:01:51 UTC-3, Jose escribió:
>
>
>
> El martes, 25 de diciembre de 2012 17:44:01 UTC-3, Alan Etkin escribió:
>>
>> I've moved the table style to web2py.css and changed the xml generation 
>>> with helpers to cleanup appadmin. Attached are the proposed diffs for 
>>> appadmin.py and web2py.css.
>>>
>>>
>> Oops! That would never work (sorry, I didn't know the library requires 
>> special html input). This new patch instead uses helpers for creating the 
>> model image. Forget about the css diff (it's useless).
>>
>
> Hi Alan
>
> in your patch [*1], face = "Helvetica Bold", it always makes it bold. 
> Originally this was not so, there in bold text (fields, pk, fk) and 
> standard texts (field type, length).
>
> regards
> Jose
>
>
> [*1] 
> rows = []
> cellpadding = 4
> color = "#7B7B7B"
> bgcolor = "#F1F2AD"
> face = "Helvetica Bold"
> border = 0
> ... 
>


 this patches it.

Jose

-- 



--- web2py/applications/welcome/controllers/appadmin.py	2012-12-26 08:53:40.0 -0300
+++ web2py/applications/borro3/controllers/appadmin.py	2012-12-26 11:19:52.0 -0300
@@ -469,8 +469,10 @@
 
 def table_template(table):
 from gluon.html import TR, TD, TABLE, TAG
+
 def FONT(*args, **kwargs):
 return TAG.font(*args, **kwargs)
+
 def types(field):
 f_type = field.type
 if not isinstance(f_type,str):
@@ -478,7 +480,7 @@
 elif f_type == 'string':
 return field.length
 elif f_type == 'id':
-return B('pk')
+return B('pk')
 elif f_type.startswith('reference') or \
 f_type.startswith('list:reference'):
 return B('fk')
@@ -490,14 +492,15 @@
 cellpadding = 4
 color = "#7B7B7B"
 bgcolor = "#F1F2AD"
-face = "Helvetica Bold"
+face = "Helvetica"
+face_bold = "Helvetica Bold"
 border = 0
 
-rows.append(TR(TD(FONT(table, _face=face, _color="white"),
+rows.append(TR(TD(FONT(table, _face=face_bold, _color="white"),
_colspan=3, _cellpadding=cellpadding,
_align="center", _bgcolor="#FFA21F")))
 for row in db[table]:
-rows.append(TR(TD(FONT(row.name, _color=color, _face=face),
+rows.append(TR(TD(FONT(row.name, _color=color, _face=face_bold),
   _align="left", _cellpadding=cellpadding,
   _border=border),
TD(FONT(row.type, _color=color, _face=face),


Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-26 Thread Jose


El martes, 25 de diciembre de 2012 17:44:01 UTC-3, Alan Etkin escribió:
>
> I've moved the table style to web2py.css and changed the xml generation 
>> with helpers to cleanup appadmin. Attached are the proposed diffs for 
>> appadmin.py and web2py.css.
>>
>>
> Oops! That would never work (sorry, I didn't know the library requires 
> special html input). This new patch instead uses helpers for creating the 
> model image. Forget about the css diff (it's useless).
>

Hi Alan

in your patch [*1], face = "Helvetica Bold", it always makes it bold. 
Originally this was not so, there in bold text (fields, pk, fk) and 
standard texts (field type, length).

regards
Jose


[*1] 
rows = []
cellpadding = 4
color = "#7B7B7B"
bgcolor = "#F1F2AD"
face = "Helvetica Bold"
border = 0
... 

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-25 Thread Jose


El martes, 25 de diciembre de 2012 14:21:00 UTC-3, Alan Etkin escribió:
>
> > On Tuesday, December 25, 2012 12:45:31 PM UTC-3, Jose wrote:
> El miércoles, 19 de diciembre de 2012 19:50:53 UTC-3, Massimo Di Pierro 
> escribió:
>>
>> Not yet. It is the queue.
>>
>
> If you are using mercurial trunk with Linux try:
>
> web2py path]$ touch NEWINSTALL
>
> And restart web2py. I think this is required for updating the welcome 
> installer.
>

work, thanks .

Jose

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-25 Thread Alan Etkin

>
> I've moved the table style to web2py.css and changed the xml generation 
> with helpers to cleanup appadmin. Attached are the proposed diffs for 
> appadmin.py and web2py.css.
>
>
Oops! That would never work (sorry, I didn't know the library requires 
special html input). This new patch instead uses helpers for creating the 
model image. Forget about the css diff (it's useless).

-- 



diff -r ae21c7198a55 applications/welcome/controllers/appadmin.py
--- a/applications/welcome/controllers/appadmin.py	Mon Dec 24 16:14:04 2012 -0600
+++ b/applications/welcome/controllers/appadmin.py	Tue Dec 25 17:38:13 2012 -0300
@@ -10,6 +10,7 @@
 import copy
 import gluon.contenttype
 import gluon.fileutils
+
 try:
 import pygraphviz as pgv
 except ImportError:
@@ -466,8 +467,10 @@
 ram=ram, disk=disk, object_stats=hp != False)
 
 
-
 def table_template(table):
+from gluon.html import TR, TD, TABLE, TAG
+def FONT(*args, **kwargs):
+return TAG.font(*args, **kwargs)
 def types(field):
 f_type = field.type
 if not isinstance(f_type,str):
@@ -481,13 +484,31 @@
 return B('fk')
 else:
 return ' '
-# this is horribe HTML but the only one graphiz understands
-header = '%s' % table
-fields = []
-for field in db[table]:
-fields.append('%s%s%s' % (field.name,field.type,types(field)))
-return '< %s %s >' % (header, ' '.join(fields))
+
+# This is horribe HTML but the only one graphiz understands
+rows = []
+cellpadding = 4
+color = "#7B7B7B"
+bgcolor = "#F1F2AD"
+face = "Helvetica Bold"
+border = 0
+
+rows.append(TR(TD(FONT(table, _face=face, _color="white"),
+   _colspan=3, _cellpadding=cellpadding,
+   _align="center", _bgcolor="#FFA21F")))
+for row in db[table]:
+rows.append(TR(TD(FONT(row.name, _color=color, _face=face),
+  _align="left", _cellpadding=cellpadding,
+  _border=border),
+   TD(FONT(row.type, _color=color, _face=face),
+   _align="left", _cellpadding=cellpadding,
+   _border=border),
+   TD(FONT(types(row), _color=color, _face=face),
+   _align="center", _cellpadding=cellpadding,
+   _border=border)))
+return "< %s >" % TABLE(*rows, _bgcolor=bgcolor, _border=1,
+_cellborder=0, _cellspacing=0).xml()
+
 
 def bg_graph_model():
 graph = pgv.AGraph(layout='dot', directed=True, strict=False, rankdir='LR')


Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-25 Thread Alan Etkin
El martes, 25 de diciembre de 2012 12:45:31 UTC-3, Jose escribió:

>
> El miércoles, 19 de diciembre de 2012 19:50:53 UTC-3, Massimo Di Pierro 
> escribió:
>>
>> Not yet. It is the queue.
>
>
I've moved the table style to web2py.css and changed the xml generation 
with helpers to cleanup appadmin. Attached are the proposed diffs for 
appadmin.py and web2py.css.

Does this feature anything else but model visualization (so far)?. I mean, 
can I manage table definitions with clic and drag, etc?

-- 



diff -r ae21c7198a55 applications/welcome/static/css/web2py.css
--- a/applications/welcome/static/css/web2py.css	Mon Dec 24 16:14:04 2012 -0600
+++ b/applications/welcome/static/css/web2py.css	Tue Dec 25 16:26:51 2012 -0300
@@ -312,3 +312,34 @@
 .ie-lte8 div.flash{ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#22', endColorstr='#00', GradientType=0 ); }
 .ie-lte8 div.flash:hover {filter:alpha(opacity=25);}
 .ie9 #w2p_query_panel {padding-bottom:2px}
+
+
+/* appadmin graph model */
+
+table.graph.model{
+  font: "Helvetica Bold";
+  background-color: "#F1F2AD";
+  border: 0.5em;
+}
+
+table.graph.model tbody{
+  color: "#7B7B7B";
+  text-align: "center";
+  padding: 0.5em;
+}
+
+table.graph.model td.left, table.graph.model td.center{
+  text-align: "left";
+}
+
+table.graph.model td.right{
+  text-align: "center";
+}
+
+table.graph.model thead{
+  color: "white";
+  text-align: "center";
+  padding: 0.5em;
+  background-color:"#FFA21F";
+}
+
diff -r ae21c7198a55 applications/welcome/controllers/appadmin.py
--- a/applications/welcome/controllers/appadmin.py	Mon Dec 24 16:14:04 2012 -0600
+++ b/applications/welcome/controllers/appadmin.py	Tue Dec 25 16:25:48 2012 -0300
@@ -481,13 +481,14 @@
 return B('fk')
 else:
 return ' '
-# this is horribe HTML but the only one graphiz understands
-header = '%s' % table
-fields = []
+
+# This is horribe HTML but the only one graphiz understands
+header = TR(TD(FONT(table), _colspan=3))
 for field in db[table]:
-fields.append('%s%s%s' % (field.name,field.type,types(field)))
-return '< %s %s >' % (header, ' '.join(fields))
+fields.append(TR(TD(FONT(field.name), _class="left"),
+ TD(FONT(field.type), _class="center"),
+ TD(FONT(types(field)), _class="right")))
+return TABLE(THEAD(header), TBODY(*fields), _class="graph model")
 
 def bg_graph_model():
 graph = pgv.AGraph(layout='dot', directed=True, strict=False, rankdir='LR')


Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-25 Thread Alan Etkin
> On Tuesday, December 25, 2012 12:45:31 PM UTC-3, Jose wrote:
El miércoles, 19 de diciembre de 2012 19:50:53 UTC-3, Massimo Di Pierro 
escribió:
>
> Not yet. It is the queue.
>

If you are using mercurial trunk with Linux try:

web2py path]$ touch NEWINSTALL

And restart web2py. I think this is required for updating the welcome 
installer.

I tried the graph action but complains about "pygraphviz library not found"

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-25 Thread Jose


El miércoles, 19 de diciembre de 2012 19:50:53 UTC-3, Massimo Di Pierro 
escribió:
>
> Not yet. It is the queue.
>

Hello Massimo.

I saw this and was implemented in the trunk.

A new application is created from the welcome folder or from welcome.w2p?
I created an application and is not available the code that implements 
graph model.

Best Regards
Jose 

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-19 Thread Massimo Di Pierro
Not yet. It is the queue.

On Wednesday, 19 December 2012 09:49:04 UTC-6, Ramos wrote:
>
> Is this in trunk?
>
>
>
> 2012/12/16 Ovidio Marinho >
>
>> Very Well Jose.
>>   
>>
>>
>>Ovidio Marinho Falcao Neto
>> Web Developer
>>  ovid...@gmail.com  
>>   ovidio...@itjp.net.br 
>>  ITJP - itjp.net.br
>>83   8826 9088 - Oi
>>83   9336 3782 - Claro
>> Brasil
>>   
>>
>>
>>
>> 2012/12/15 Jose >
>>
>>> new patch with small changes
>>>
>>> Jose
>>>
>>> -- 
>>>  
>>>  
>>>  
>>>
>>
>>  -- 
>>  
>>  
>>  
>>
>
>

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-19 Thread António Ramos
Is this in trunk?



2012/12/16 Ovidio Marinho 

> Very Well Jose.
>
>
>
>Ovidio Marinho Falcao Neto
> Web Developer
>  ovidio...@gmail.com
>   ovidiomari...@itjp.net.br
>  ITJP - itjp.net.br
>83   8826 9088 - Oi
>83   9336 3782 - Claro
> Brasil
>
>
>
>
> 2012/12/15 Jose 
>
>> new patch with small changes
>>
>> Jose
>>
>> --
>>
>>
>>
>>
>
>  --
>
>
>
>

-- 





Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-15 Thread Ovidio Marinho
Very Well Jose.



   Ovidio Marinho Falcao Neto
Web Developer
 ovidio...@gmail.com
  ovidiomari...@itjp.net.br
 ITJP - itjp.net.br
   83   8826 9088 - Oi
   83   9336 3782 - Claro
Brasil




2012/12/15 Jose 

> new patch with small changes
>
> Jose
>
> --
>
>
>
>

--