Table-specific validations Check that font_colors is supplied correctly (1, 3, or len(text) colors). :raises: (PlotlyError) If font_colors is supplied incorretly. See FigureFactory.create_table() for params
(table_text, font_colors)
| 5 | |
| 6 | |
| 7 | def validate_table(table_text, font_colors): |
| 8 | """ |
| 9 | Table-specific validations |
| 10 | |
| 11 | Check that font_colors is supplied correctly (1, 3, or len(text) |
| 12 | colors). |
| 13 | |
| 14 | :raises: (PlotlyError) If font_colors is supplied incorretly. |
| 15 | |
| 16 | See FigureFactory.create_table() for params |
| 17 | """ |
| 18 | font_colors_len_options = [1, 3, len(table_text)] |
| 19 | if len(font_colors) not in font_colors_len_options: |
| 20 | raise exceptions.PlotlyError( |
| 21 | "Oops, font_colors should be a list of length 1, 3 or len(text)" |
| 22 | ) |
| 23 | |
| 24 | |
| 25 | def create_table( |