( manager, x, y, log = false, autoLayout = false )
| 59 | } |
| 60 | |
| 61 | export async function create_figure_scatter( |
| 62 | manager, |
| 63 | x, |
| 64 | y, |
| 65 | log = false, |
| 66 | autoLayout = false |
| 67 | ) { |
| 68 | const layout = await create_model( |
| 69 | manager, |
| 70 | '@jupyter-widgets/base', |
| 71 | 'LayoutModel', |
| 72 | 'LayoutView', |
| 73 | 'layout_figure1', |
| 74 | { _dom_classes: '', width: '400px', height: '500px' } |
| 75 | ); |
| 76 | let scale_x; |
| 77 | let scale_y; |
| 78 | if (log) { |
| 79 | scale_x = await create_model_bqscales(manager, 'LogScale', 'scale_x', { |
| 80 | min: 0.01, |
| 81 | max: 100, |
| 82 | allow_padding: false, |
| 83 | }); |
| 84 | scale_y = await create_model_bqscales(manager, 'LogScale', 'scale_y', { |
| 85 | min: 0.1, |
| 86 | max: 10, |
| 87 | allow_padding: false, |
| 88 | }); |
| 89 | } else { |
| 90 | scale_x = await create_model_bqscales(manager, 'LinearScale', 'scale_x', { |
| 91 | min: 0, |
| 92 | max: 1, |
| 93 | allow_padding: false, |
| 94 | }); |
| 95 | scale_y = await create_model_bqscales(manager, 'LinearScale', 'scale_y', { |
| 96 | min: 2, |
| 97 | max: 3, |
| 98 | allow_padding: false, |
| 99 | }); |
| 100 | } |
| 101 | // TODO: the default values for the ColorScale should not be required, but defined in the defaults method |
| 102 | const scale_color = await create_model_bqscales( |
| 103 | manager, |
| 104 | 'ColorScale', |
| 105 | 'scale_color', |
| 106 | { scheme: 'RdYlGn', colors: [] } |
| 107 | ); |
| 108 | const scales = { |
| 109 | x: scale_x.toJSON(), |
| 110 | y: scale_y.toJSON(), |
| 111 | color: scale_color.toJSON(), |
| 112 | }; |
| 113 | const color = null; |
| 114 | const size = null; |
| 115 | const opacity = null; |
| 116 | const rotation = null; |
| 117 | const skew = null; |
| 118 |
no test coverage detected
searching dependent graphs…