Returns a kwarg dict suitable for a ColorScale
(cmap)
| 511 | |
| 512 | |
| 513 | def _process_cmap(cmap): |
| 514 | ''' |
| 515 | Returns a kwarg dict suitable for a ColorScale |
| 516 | ''' |
| 517 | option = {} |
| 518 | if isinstance(cmap, str): |
| 519 | option['scheme'] = cmap |
| 520 | elif isinstance(cmap, list): |
| 521 | option['colors'] = cmap |
| 522 | else: |
| 523 | raise ValueError('''`cmap` must be a string (name of a color scheme) |
| 524 | or a list of colors, but a value of {} was given |
| 525 | '''.format(cmap)) |
| 526 | return option |
| 527 | |
| 528 | |
| 529 | def set_cmap(cmap): |
no outgoing calls
no test coverage detected
searching dependent graphs…