lets-plot 4.8.1rc1__cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. lets_plot/__init__.py +382 -0
  2. lets_plot/_global_settings.py +192 -0
  3. lets_plot/_kbridge.py +197 -0
  4. lets_plot/_type_utils.py +133 -0
  5. lets_plot/_version.py +6 -0
  6. lets_plot/bistro/__init__.py +16 -0
  7. lets_plot/bistro/_plot2d_common.py +106 -0
  8. lets_plot/bistro/corr.py +448 -0
  9. lets_plot/bistro/im.py +196 -0
  10. lets_plot/bistro/joint.py +192 -0
  11. lets_plot/bistro/qq.py +207 -0
  12. lets_plot/bistro/residual.py +341 -0
  13. lets_plot/bistro/waterfall.py +332 -0
  14. lets_plot/export/__init__.py +6 -0
  15. lets_plot/export/ggsave_.py +172 -0
  16. lets_plot/frontend_context/__init__.py +8 -0
  17. lets_plot/frontend_context/_configuration.py +140 -0
  18. lets_plot/frontend_context/_dynamic_configure_html.py +115 -0
  19. lets_plot/frontend_context/_frontend_ctx.py +16 -0
  20. lets_plot/frontend_context/_html_contexts.py +223 -0
  21. lets_plot/frontend_context/_intellij_python_json_ctx.py +38 -0
  22. lets_plot/frontend_context/_isolated_webview_panel_ctx.py +81 -0
  23. lets_plot/frontend_context/_json_contexts.py +39 -0
  24. lets_plot/frontend_context/_jupyter_notebook_ctx.py +82 -0
  25. lets_plot/frontend_context/_mime_types.py +7 -0
  26. lets_plot/frontend_context/_static_html_page_ctx.py +76 -0
  27. lets_plot/frontend_context/_static_svg_ctx.py +26 -0
  28. lets_plot/frontend_context/_webbr_html_page_ctx.py +29 -0
  29. lets_plot/frontend_context/sandbox.py +5 -0
  30. lets_plot/geo_data/__init__.py +19 -0
  31. lets_plot/geo_data/core.py +335 -0
  32. lets_plot/geo_data/geocoder.py +988 -0
  33. lets_plot/geo_data/geocodes.py +512 -0
  34. lets_plot/geo_data/gis/__init__.py +0 -0
  35. lets_plot/geo_data/gis/fluent_dict.py +201 -0
  36. lets_plot/geo_data/gis/geocoding_service.py +42 -0
  37. lets_plot/geo_data/gis/geometry.py +91 -0
  38. lets_plot/geo_data/gis/json_request.py +232 -0
  39. lets_plot/geo_data/gis/json_response.py +308 -0
  40. lets_plot/geo_data/gis/request.py +492 -0
  41. lets_plot/geo_data/gis/response.py +247 -0
  42. lets_plot/geo_data/livemap_helper.py +65 -0
  43. lets_plot/geo_data/to_geo_data_frame.py +141 -0
  44. lets_plot/geo_data/type_assertion.py +34 -0
  45. lets_plot/geo_data_internals/__init__.py +4 -0
  46. lets_plot/geo_data_internals/constants.py +13 -0
  47. lets_plot/geo_data_internals/utils.py +33 -0
  48. lets_plot/mapping.py +115 -0
  49. lets_plot/package_data/lets-plot.min.js +3 -0
  50. lets_plot/plot/__init__.py +64 -0
  51. lets_plot/plot/_global_theme.py +14 -0
  52. lets_plot/plot/annotation.py +290 -0
  53. lets_plot/plot/coord.py +242 -0
  54. lets_plot/plot/core.py +1071 -0
  55. lets_plot/plot/expand_limits_.py +78 -0
  56. lets_plot/plot/facet.py +210 -0
  57. lets_plot/plot/font_features.py +71 -0
  58. lets_plot/plot/geom.py +9146 -0
  59. lets_plot/plot/geom_extras.py +53 -0
  60. lets_plot/plot/geom_function_.py +219 -0
  61. lets_plot/plot/geom_imshow_.py +393 -0
  62. lets_plot/plot/geom_livemap_.py +343 -0
  63. lets_plot/plot/ggbunch_.py +96 -0
  64. lets_plot/plot/gggrid_.py +139 -0
  65. lets_plot/plot/ggtb_.py +81 -0
  66. lets_plot/plot/guide.py +231 -0
  67. lets_plot/plot/label.py +187 -0
  68. lets_plot/plot/marginal_layer.py +181 -0
  69. lets_plot/plot/plot.py +245 -0
  70. lets_plot/plot/pos.py +344 -0
  71. lets_plot/plot/sampling.py +338 -0
  72. lets_plot/plot/sandbox_.py +26 -0
  73. lets_plot/plot/scale.py +3580 -0
  74. lets_plot/plot/scale_colormap_mpl.py +300 -0
  75. lets_plot/plot/scale_convenience.py +155 -0
  76. lets_plot/plot/scale_identity_.py +653 -0
  77. lets_plot/plot/scale_position.py +1342 -0
  78. lets_plot/plot/series_meta.py +209 -0
  79. lets_plot/plot/stat.py +585 -0
  80. lets_plot/plot/subplots.py +331 -0
  81. lets_plot/plot/subplots_util.py +24 -0
  82. lets_plot/plot/theme_.py +790 -0
  83. lets_plot/plot/theme_set.py +418 -0
  84. lets_plot/plot/tooltip.py +486 -0
  85. lets_plot/plot/util.py +267 -0
  86. lets_plot/settings_utils.py +244 -0
  87. lets_plot/tilesets.py +429 -0
  88. lets_plot-4.8.1rc1.dist-info/METADATA +221 -0
  89. lets_plot-4.8.1rc1.dist-info/RECORD +97 -0
  90. lets_plot-4.8.1rc1.dist-info/WHEEL +6 -0
  91. lets_plot-4.8.1rc1.dist-info/licenses/LICENSE +21 -0
  92. lets_plot-4.8.1rc1.dist-info/licenses/licenses/LICENSE.FreeType +166 -0
  93. lets_plot-4.8.1rc1.dist-info/licenses/licenses/LICENSE.ImageMagick +106 -0
  94. lets_plot-4.8.1rc1.dist-info/licenses/licenses/LICENSE.expat +21 -0
  95. lets_plot-4.8.1rc1.dist-info/licenses/licenses/LICENSE.fontconfig +200 -0
  96. lets_plot-4.8.1rc1.dist-info/top_level.txt +2 -0
  97. lets_plot_kotlin_bridge.cpython-311-x86_64-linux-gnu.so +0 -0
@@ -0,0 +1,418 @@
1
+ #
2
+ # Copyright (c) 2019. JetBrains s.r.o.
3
+ # Use of this source code is governed by the MIT license that can be found in the LICENSE file.
4
+ #
5
+ from .core import FeatureSpec
6
+
7
+ __all__ = [
8
+ 'theme_grey',
9
+ 'theme_gray',
10
+ 'theme_light',
11
+ 'theme_classic',
12
+ 'theme_minimal',
13
+ 'theme_minimal2',
14
+ 'theme_none',
15
+ 'theme_bw',
16
+ 'theme_void',
17
+ 'flavor_darcula',
18
+ 'flavor_solarized_light',
19
+ 'flavor_solarized_dark',
20
+ 'flavor_high_contrast_light',
21
+ 'flavor_high_contrast_dark',
22
+ 'flavor_standard'
23
+ ]
24
+
25
+
26
+ def theme_grey():
27
+ """
28
+ Set the grey background with white gridlines.
29
+
30
+ Returns
31
+ -------
32
+ ``FeatureSpec``
33
+ Theme specification.
34
+
35
+ Examples
36
+ --------
37
+ .. jupyter-execute::
38
+ :linenos:
39
+ :emphasize-lines: 7
40
+
41
+ import numpy as np
42
+ from lets_plot import *
43
+ LetsPlot.setup_html()
44
+ np.random.seed(42)
45
+ data = {'x': np.random.normal(size=1000)}
46
+ ggplot(data, aes(x='x')) + geom_histogram() + \\
47
+ theme_grey()
48
+
49
+ """
50
+ return FeatureSpec('theme', name="grey")
51
+
52
+
53
+ def theme_gray():
54
+ """
55
+ Set the gray background with white gridlines. It is an alias for `theme_grey() <https://lets-plot.org/python/pages/api/lets_plot.theme_grey.html>`__
56
+ """
57
+ return FeatureSpec('theme', name="gray")
58
+
59
+
60
+ def theme_light():
61
+ """
62
+ Set the light grey lines of various widths on the white background.
63
+
64
+ Returns
65
+ -------
66
+ ``FeatureSpec``
67
+ Theme specification.
68
+
69
+ Examples
70
+ --------
71
+ .. jupyter-execute::
72
+ :linenos:
73
+ :emphasize-lines: 7
74
+
75
+ import numpy as np
76
+ from lets_plot import *
77
+ LetsPlot.setup_html()
78
+ np.random.seed(42)
79
+ data = {'x': np.random.normal(size=1000)}
80
+ ggplot(data, aes(x='x')) + geom_histogram() + \\
81
+ theme_light()
82
+
83
+ """
84
+ return FeatureSpec('theme', name="light")
85
+
86
+
87
+ def theme_classic():
88
+ """
89
+ Set the dark grey axes and no gridlines on the white background.
90
+
91
+ Returns
92
+ -------
93
+ ``FeatureSpec``
94
+ Theme specification.
95
+
96
+ Examples
97
+ --------
98
+ .. jupyter-execute::
99
+ :linenos:
100
+ :emphasize-lines: 7
101
+
102
+ import numpy as np
103
+ from lets_plot import *
104
+ LetsPlot.setup_html()
105
+ np.random.seed(42)
106
+ data = {'x': np.random.normal(size=1000)}
107
+ ggplot(data, aes(x='x')) + geom_histogram() + \\
108
+ theme_classic()
109
+
110
+ """
111
+ return FeatureSpec('theme', name="classic")
112
+
113
+
114
+ def theme_minimal():
115
+ """
116
+ Set a minimalistic theme without axes lines.
117
+
118
+ Returns
119
+ -------
120
+ ``FeatureSpec``
121
+ Theme specification.
122
+
123
+ Examples
124
+ --------
125
+ .. jupyter-execute::
126
+ :linenos:
127
+ :emphasize-lines: 7
128
+
129
+ import numpy as np
130
+ from lets_plot import *
131
+ LetsPlot.setup_html()
132
+ np.random.seed(42)
133
+ data = {'x': np.random.normal(size=1000)}
134
+ ggplot(data, aes(x='x')) + geom_histogram() + \\
135
+ theme_minimal()
136
+
137
+ """
138
+ return FeatureSpec('theme', name="minimal")
139
+
140
+
141
+ def theme_minimal2():
142
+ """
143
+ Set the default theme similar to `theme_minimal() <https://lets-plot.org/python/pages/api/lets_plot.theme_minimal.html>`__
144
+ adding an x-axis line and only major gridlines.
145
+
146
+ Returns
147
+ -------
148
+ ``FeatureSpec``
149
+ Theme specification.
150
+
151
+ Examples
152
+ --------
153
+ .. jupyter-execute::
154
+ :linenos:
155
+ :emphasize-lines: 7
156
+
157
+ import numpy as np
158
+ from lets_plot import *
159
+ LetsPlot.setup_html()
160
+ np.random.seed(42)
161
+ data = {'x': np.random.normal(size=1000)}
162
+ ggplot(data, aes(x='x')) + geom_histogram() + \\
163
+ theme_minimal2()
164
+
165
+ """
166
+ return FeatureSpec('theme', name="minimal2")
167
+
168
+
169
+ def theme_none():
170
+ """
171
+ Set a basic blue-accented scheme with the light blue background.
172
+
173
+ Returns
174
+ -------
175
+ ``FeatureSpec``
176
+ Theme specification.
177
+
178
+ Examples
179
+ --------
180
+ .. jupyter-execute::
181
+ :linenos:
182
+ :emphasize-lines: 7
183
+
184
+ import numpy as np
185
+ from lets_plot import *
186
+ LetsPlot.setup_html()
187
+ np.random.seed(42)
188
+ data = {'x': np.random.normal(size=1000)}
189
+ ggplot(data, aes(x='x')) + geom_histogram() + \\
190
+ theme_none()
191
+
192
+ """
193
+ return FeatureSpec('theme', name="none")
194
+
195
+
196
+ def theme_bw():
197
+ """
198
+ Set a dark grey plot border and grey gridlines on the white background.
199
+
200
+ Returns
201
+ -------
202
+ ``FeatureSpec``
203
+ Theme specification.
204
+
205
+ Examples
206
+ --------
207
+ .. jupyter-execute::
208
+ :linenos:
209
+ :emphasize-lines: 7
210
+
211
+ import numpy as np
212
+ from lets_plot import *
213
+ LetsPlot.setup_html()
214
+ np.random.seed(42)
215
+ data = {'x': np.random.normal(size=1000)}
216
+ ggplot(data, aes(x='x')) + geom_histogram() + \\
217
+ theme_bw()
218
+
219
+ """
220
+ return FeatureSpec('theme', name="bw")
221
+
222
+
223
+ def theme_void():
224
+ """
225
+ Set a completely blank (or "void") background theme by removing all
226
+ non-data elements: no borders, axes, or gridlines.
227
+
228
+ Returns
229
+ -------
230
+ ``FeatureSpec``
231
+ Theme specification.
232
+
233
+ Examples
234
+ --------
235
+ .. jupyter-execute::
236
+ :linenos:
237
+ :emphasize-lines: 7
238
+
239
+ import numpy as np
240
+ from lets_plot import *
241
+ LetsPlot.setup_html()
242
+ np.random.seed(42)
243
+ data = {'x': np.random.normal(size=1000)}
244
+ ggplot(data, aes(x='x')) + geom_histogram() + \\
245
+ theme_void()
246
+
247
+ """
248
+ blank_elems = {'line': 'blank', 'axis': 'blank'}
249
+ return theme_classic() + FeatureSpec('theme', name=None, **blank_elems)
250
+
251
+
252
+ def flavor_darcula():
253
+ """
254
+ Set the Darcula color scheme.
255
+
256
+ Returns
257
+ -------
258
+ ``FeatureSpec``
259
+ Theme specification.
260
+
261
+ Examples
262
+ --------
263
+ .. jupyter-execute::
264
+ :linenos:
265
+ :emphasize-lines: 11
266
+
267
+ import numpy as np
268
+ from lets_plot import *
269
+ LetsPlot.setup_html()
270
+ data = {'name': ['pen', 'brush', 'paper'],
271
+ 'slice': [1, 3, 3]}
272
+ ggplot(data) + \\
273
+ geom_pie(aes(fill='name', slice='slice'),
274
+ stat='identity', color='pen',
275
+ tooltips='none', labels=layer_labels().line('@name')) + \\
276
+ scale_fill_manual(['pen', 'brush', 'paper']) + \\
277
+ flavor_darcula()
278
+
279
+ """
280
+ return FeatureSpec('theme', name=None, flavor="darcula")
281
+
282
+
283
+ def flavor_solarized_light():
284
+ """
285
+ Set the Solarized Light color scheme.
286
+
287
+ Returns
288
+ -------
289
+ ``FeatureSpec``
290
+ Theme specification.
291
+
292
+ Examples
293
+ --------
294
+ .. jupyter-execute::
295
+ :linenos:
296
+ :emphasize-lines: 11
297
+
298
+ import numpy as np
299
+ from lets_plot import *
300
+ LetsPlot.setup_html()
301
+ data = {'name': ['pen', 'brush', 'paper'],
302
+ 'slice': [1, 3, 3]}
303
+ ggplot(data) + \\
304
+ geom_pie(aes(fill='name', slice='slice'),
305
+ stat='identity', color='pen',
306
+ tooltips='none', labels=layer_labels().line('@name')) + \\
307
+ scale_fill_manual(['pen', 'brush', 'paper']) + \\
308
+ flavor_solarized_light()
309
+
310
+ """
311
+ return FeatureSpec('theme', name=None, flavor="solarized_light")
312
+
313
+
314
+ def flavor_solarized_dark():
315
+ """
316
+ Set the Solarized Dark color scheme.
317
+
318
+ Returns
319
+ -------
320
+ ``FeatureSpec``
321
+ Theme specification.
322
+
323
+ Examples
324
+ --------
325
+ .. jupyter-execute::
326
+ :linenos:
327
+ :emphasize-lines: 11
328
+
329
+ import numpy as np
330
+ from lets_plot import *
331
+ LetsPlot.setup_html()
332
+ data = {'name': ['pen', 'brush', 'paper'],
333
+ 'slice': [1, 3, 3]}
334
+ ggplot(data) + \\
335
+ geom_pie(aes(fill='name', slice='slice'),
336
+ stat='identity', color='pen',
337
+ tooltips='none', labels=layer_labels().line('@name')) + \\
338
+ scale_fill_manual(['pen', 'brush', 'paper']) + \\
339
+ flavor_solarized_dark()
340
+
341
+ """
342
+ return FeatureSpec('theme', name=None, flavor="solarized_dark")
343
+
344
+
345
+ def flavor_high_contrast_light():
346
+ """
347
+ Set a high-contrast light color scheme.
348
+
349
+ Returns
350
+ -------
351
+ ``FeatureSpec``
352
+ Theme specification.
353
+
354
+ Examples
355
+ --------
356
+ .. jupyter-execute::
357
+ :linenos:
358
+ :emphasize-lines: 11
359
+
360
+ import numpy as np
361
+ from lets_plot import *
362
+ LetsPlot.setup_html()
363
+ data = {'name': ['pen', 'brush', 'paper'],
364
+ 'slice': [1, 3, 3]}
365
+ ggplot(data) + \\
366
+ geom_pie(aes(fill='name', slice='slice'),
367
+ stat='identity', color='pen',
368
+ tooltips='none', labels=layer_labels().line('@name')) + \\
369
+ scale_fill_manual(['pen', 'brush', 'paper']) + \\
370
+ flavor_high_contrast_light()
371
+
372
+ """
373
+ return FeatureSpec('theme', name=None, flavor="high_contrast_light")
374
+
375
+
376
+ def flavor_high_contrast_dark():
377
+ """
378
+ Set a high-contrast dark color scheme.
379
+
380
+ Returns
381
+ -------
382
+ ``FeatureSpec``
383
+ Theme specification.
384
+
385
+ Examples
386
+ --------
387
+ .. jupyter-execute::
388
+ :linenos:
389
+ :emphasize-lines: 11
390
+
391
+ import numpy as np
392
+ from lets_plot import *
393
+ LetsPlot.setup_html()
394
+ data = {'name': ['pen', 'brush', 'paper'],
395
+ 'slice': [1, 3, 3]}
396
+ ggplot(data) + \\
397
+ geom_pie(aes(fill='name', slice='slice'),
398
+ stat='identity', color='pen',
399
+ tooltips='none', labels=layer_labels().line('@name')) + \\
400
+ scale_fill_manual(['pen', 'brush', 'paper']) + \\
401
+ flavor_high_contrast_dark()
402
+
403
+ """
404
+ return FeatureSpec('theme', name=None, flavor="high_contrast_dark")
405
+
406
+
407
+ def flavor_standard():
408
+ """
409
+ Set the theme’s default color scheme.
410
+ Use to override other flavors or to make defaults explicit.
411
+
412
+ Returns
413
+ -------
414
+ ``FeatureSpec``
415
+ Theme specification.
416
+
417
+ """
418
+ return FeatureSpec('theme', name=None, flavor="standard")