#7267: Add a compact color picker to SageNB
---------------------------+------------------------------------------------
   Reporter:  mpatel       |       Owner:  boothby     
       Type:  enhancement  |      Status:  needs_review
   Priority:  minor        |   Milestone:              
  Component:  notebook     |    Keywords:              
Work_issues:               |      Author:  Mitesh Patel
   Reviewer:               |      Merged:              
---------------------------+------------------------------------------------
Changes (by newvalueoldvalue):

 * cc: jason, was (added)
  * status:  new => needs_review
  * author:  => Mitesh Patel


Comment:

 There's a patch at

  *
 
http://sage.math.washington.edu/home/mpatel/trac/7267/trac_7267_color_choosers.patch

 The patch

  * Adds both [http://www.eyecon.ro/colorpicker/ ColorPicker] and
 [http://www.digitalmagicpro.com/jPicker/ jPicker].
  * Adds a dedicated `color_selector()` `interact` control.  The keyword
 option
    * `widget` selects the widget to render.  The choices are
 `'farbtastic'` (the default), `'jpicker'`, and `'colorpicker'`.
    * `hide_box` (default: `False`) sets whether the input box is visible.

 Here's a compact example:
 {{{
 #!python
 @interact
 def _(color=color_selector((1,0,1), label='', widget='jpicker',
 hide_box=True)):
     show(plot(x / (8/7 + sin(x)), (x, -50, 50), fill=True,
 fillcolor=color))
 }}}

 Remarks:

  * jPicker adds itself as a (grand)^n^-child of the output cell, so it's
 confined to that area.  This is a problem, e.g., when `auto_update=False`
 and a plot disappears.  The smarter !ColorPicker appends itself to
 `document.body`, similarly to jQuery UI's dialogs.

  * Continuously or rapidly changing ''any'' of the widgets sends so many
 requests to the server that a rendered `interact`'s final color may not
 match the final selected color.  The server does receive the final color,
 according to a print statement in `twist.Worksheet_eval`.  I'm not sure
 what happens to the corresponding output.  Anyway, I think this is an
 important but separate problem.

  * In a future ticket, I'll set up one of the new choosers for user,
 worksheet, and notebook settings pages.  See
 `sagenb.notebook.conf.Configuration.html_table()` and `server_conf` for
 details.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7267#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to