lets-plot 4.6.1__cp311-cp311-macosx_11_0_arm64.whl → 4.7.0rc1__cp311-cp311-macosx_11_0_arm64.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.

Potentially problematic release.


This version of lets-plot might be problematic. Click here for more details.

Files changed (35) hide show
  1. lets_plot/_global_settings.py +5 -0
  2. lets_plot/_kbridge.py +7 -0
  3. lets_plot/_type_utils.py +29 -6
  4. lets_plot/_version.py +1 -1
  5. lets_plot/bistro/im.py +2 -2
  6. lets_plot/bistro/waterfall.py +93 -12
  7. lets_plot/export/ggsave_.py +23 -15
  8. lets_plot/frontend_context/_configuration.py +8 -1
  9. lets_plot/geo_data/__init__.py +2 -1
  10. lets_plot/package_data/lets-plot.min.js +2 -1
  11. lets_plot/plot/annotation.py +75 -18
  12. lets_plot/plot/core.py +147 -30
  13. lets_plot/plot/geom.py +730 -89
  14. lets_plot/plot/geom_function_.py +1 -1
  15. lets_plot/plot/geom_imshow_.py +42 -51
  16. lets_plot/plot/geom_livemap_.py +2 -22
  17. lets_plot/plot/ggtb_.py +0 -1
  18. lets_plot/plot/pos.py +13 -44
  19. lets_plot/plot/scale_position.py +9 -3
  20. lets_plot/plot/series_meta.py +179 -105
  21. lets_plot/plot/stat.py +4 -4
  22. lets_plot/plot/subplots.py +4 -4
  23. lets_plot/plot/theme_.py +55 -52
  24. lets_plot/plot/util.py +15 -4
  25. lets_plot/tilesets.py +69 -4
  26. {lets_plot-4.6.1.dist-info → lets_plot-4.7.0rc1.dist-info}/METADATA +28 -20
  27. {lets_plot-4.6.1.dist-info → lets_plot-4.7.0rc1.dist-info}/RECORD +35 -31
  28. {lets_plot-4.6.1.dist-info → lets_plot-4.7.0rc1.dist-info}/WHEEL +1 -1
  29. lets_plot-4.7.0rc1.dist-info/licenses/licenses/LICENSE.FreeType +166 -0
  30. lets_plot-4.7.0rc1.dist-info/licenses/licenses/LICENSE.ImageMagick +106 -0
  31. lets_plot-4.7.0rc1.dist-info/licenses/licenses/LICENSE.expat +21 -0
  32. lets_plot-4.7.0rc1.dist-info/licenses/licenses/LICENSE.fontconfig +200 -0
  33. lets_plot_kotlin_bridge.cpython-311-darwin.so +0 -0
  34. {lets_plot-4.6.1.dist-info → lets_plot-4.7.0rc1.dist-info/licenses}/LICENSE +0 -0
  35. {lets_plot-4.6.1.dist-info → lets_plot-4.7.0rc1.dist-info}/top_level.txt +0 -0
@@ -221,10 +221,10 @@ class SupPlotsSpec(FeatureSpec):
221
221
  h : float, default=None
222
222
  Height of the output image in units.
223
223
  Only applicable when exporting to PNG or PDF.
224
- unit : {'in', 'cm', 'mm'}, default=None
224
+ unit : {'in', 'cm', 'mm'}, default='in'
225
225
  Unit of the output image. One of: 'in', 'cm', 'mm'.
226
226
  Only applicable when exporting to PNG or PDF.
227
- dpi : int, default=None
227
+ dpi : int, default=300
228
228
  Resolution in dots per inch.
229
229
  Only applicable when exporting to PNG or PDF.
230
230
 
@@ -282,10 +282,10 @@ class SupPlotsSpec(FeatureSpec):
282
282
  h : float, default=None
283
283
  Height of the output image in units.
284
284
  Only applicable when exporting to PNG or PDF.
285
- unit : {'in', 'cm', 'mm'}, default=None
285
+ unit : {'in', 'cm', 'mm'}, default='in'
286
286
  Unit of the output image. One of: 'in', 'cm', 'mm'.
287
287
  Only applicable when exporting to PNG or PDF.
288
- dpi : int, default=None
288
+ dpi : int, default=300
289
289
  Resolution in dots per inch.
290
290
  Only applicable when exporting to PNG or PDF.
291
291
 
lets_plot/plot/theme_.py CHANGED
@@ -32,6 +32,7 @@ def theme(*,
32
32
  axis_text=None, axis_text_x=None, axis_text_y=None,
33
33
  # ToDo: axis.text.x.top, axis.text.x.bottom
34
34
  # ToDo: axis.text.x.left, axis.text.x.right
35
+ axis_text_spacing=None, axis_text_spacing_x=None, axis_text_spacing_y=None,
35
36
  axis_ticks=None, axis_ticks_x=None, axis_ticks_y=None,
36
37
  # ToDo: axis.ticks.x.top, axis.ticks.x.bottom
37
38
  # ToDo: axis.ticks.x.left, axis.ticks.x.right
@@ -116,59 +117,61 @@ def theme(*,
116
117
 
117
118
  Superscript is not supported when exporting to PNG/PDF.
118
119
  line : str or dict
119
- All line elements.
120
+ Style settings for all line elements.
120
121
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
121
122
  Set `element_line()` to specify line parameters.
122
123
  rect : str or dict
123
- All rectangular elements.
124
+ Style settings for all rectangular elements.
124
125
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
125
126
  Set `element_rect()` to specify rectangular element parameters.
126
127
  text : str or dict
127
- All text elements.
128
+ Style settings for all text elements.
128
129
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
129
130
  Set `element_text()` to specify text parameters.
130
131
  title : str or dict
131
- All title elements: plot, axes, legends.
132
+ Style settings for all title elements: plot, axes, legends.
132
133
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
133
134
  Set `element_text()` to specify title text parameters, inherited from `text`.
134
135
  axis : str or dict
135
- All axis elements: lines, ticks, texts, titles.
136
+ Style settings for all axis elements: lines, ticks, texts, titles.
136
137
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
137
138
  Set `element_line()` to specify axes parameters.
138
139
  axis_ontop, axis_ontop_x, axis_ontop_y : bool, default=True
139
140
  Option to place axis (lines, tickmarks and labels) over the data layers.
140
141
  axis_title, axis_title_x, axis_title_y : str or dict
141
- Labels of axes.
142
+ Style settings for axis titles.
142
143
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
143
- Set `element_text()` to specify axes label parameters.
144
+ Set `element_text()` to specify axis title parameters.
144
145
  `axis_title_*` inherits from `axis_title` which inherits from `text`.
145
146
  axis_text, axis_text_x, axis_text_y : str or dict
146
- Tick labels along axes.
147
+ Style settings for tick labels along axes.
147
148
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
148
149
  Set `element_text()` to specify all axes tick label parameters.
149
150
  `axis_text_*` inherits from `axis_text` which inherits from `text`.
151
+ axis_text_spacing, axis_text_spacing_x, axis_text_spacing_y : float
152
+ Spacing between the axis label text and its tick mark.
150
153
  axis_ticks, axis_ticks_x, axis_ticks_y : str or dict
151
- Tick marks along axes.
154
+ Style settings for tick marks along axes.
152
155
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
153
156
  Set `element_line()` to specify all tick mark parameters.
154
157
  `axis_ticks_*` inherits from `axis_ticks` which inherits from `line`.
155
158
  axis_ticks_length, axis_ticks_length_x, axis_ticks_length_y : float
156
159
  Length of tick marks in px.
157
160
  axis_line, axis_line_x, axis_line_y : str or dict
158
- Lines along axes.
161
+ Style settings for lines along axes.
159
162
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
160
163
  Set `element_line()` to specify line parameters along all axes.
161
164
  `axis_line_*` inherits from `axis_line` which inherits from `line`.
162
165
  legend_background : str or dict
163
- Background of legend.
166
+ Style settings for background of legend.
164
167
  Set 'blank' or result of `element_blank()` to draw nothing.
165
168
  Set `element_rect()` to specify legend background parameters, inherited from `rect`.
166
169
  legend_text : str or dict
167
- Legend item labels.
170
+ Style settings for legend item labels.
168
171
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
169
172
  Set `element_text()` to specify legend item label parameters, inherited from `text`.
170
173
  legend_title : str or dict
171
- Title of legend.
174
+ Style settings for legend title.
172
175
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
173
176
  Set `element_text()` to specify legend title parameters, inherited from `title`.
174
177
  legend_position : {'none', 'left', 'right', 'bottom', 'top'} or list
@@ -187,7 +190,7 @@ def theme(*,
187
190
  Margin around each legend.
188
191
  The margin may be specified using a number or a list of numbers:
189
192
 
190
- - a number or list of one number - the same margin it applied to all four sides;
193
+ - a number or list of one number - the same margin is applied to all four sides;
191
194
  - a list of two numbers - the first margin applies to the top and bottom, the second - to the left and right;
192
195
  - a list of three numbers - the first margin applies to the top, the second - to the right and left, the third - to the bottom;
193
196
  - a list of four numbers - the margins are applied to the top, right, bottom and left in that order.
@@ -200,7 +203,7 @@ def theme(*,
200
203
  legend_spacing_y : float
201
204
  Spacing between legends in the vertical direction, inherited from `legend_spacing`.
202
205
  legend_key : str or dict
203
- Background underneath legend keys.
206
+ Style settings for legend key background.
204
207
  Set 'blank' or result of `element_blank()` to draw nothing.
205
208
  Set `element_rect()` to specify legend key background parameters, inherited from `rect`.
206
209
  legend_key_size : float
@@ -222,7 +225,7 @@ def theme(*,
222
225
  legend_box_spacing : float
223
226
  Spacing between plotting area and legend box.
224
227
  legend_ticks : str or dict
225
- Tick marks in colorbars.
228
+ Style settings for tick marks in colorbars.
226
229
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
227
230
  Set `element_line()` to specify all tick mark parameters.
228
231
  `legend_ticks_*` DOES NOT inherit from `line`.
@@ -230,58 +233,58 @@ def theme(*,
230
233
  legend_ticks_length : float
231
234
  Length of colorbar tick marks in px.
232
235
  panel_background : str or dict
233
- Background of plotting area.
236
+ Style settings for background of plotting area.
234
237
  Set 'blank' or result of `element_blank()` to draw nothing.
235
238
  Set `element_rect()` to specify plotting area background parameters, inherited from `rect`.
236
239
  panel_border : str or dict
237
- Border around plotting area.
240
+ Style settings for border around plotting area.
238
241
  Set 'blank' or result of `element_blank()` to draw nothing.
239
242
  Set `element_rect()` to specify border parameters, inherited from `rect`.
240
243
  panel_border_ontop : bool, default=True
241
244
  Option to place border around plotting area over the data layers.
242
245
  panel_grid, panel_grid_major, panel_grid_minor, panel_grid_major_x, panel_grid_major_y, panel_grid_minor_x, panel_grid_minor_y : str or dict
243
- Grid lines. Specify major grid lines or minor grid lines separately if needed.
246
+ Style settings for grid lines. Specify major grid lines or minor grid lines separately if needed.
244
247
  Set 'blank' or result of `element_blank()` to draw nothing.
245
248
  Set `element_line()` to specify grid line parameters.
246
249
  `panel_grid_*_*` inherits from `panel_grid_*` which inherits from `panel_grid`,
247
250
  which in turn inherits from `line`.
248
251
  panel_inset : number or list of numbers
249
- Inset for a panel. The inset behaves like a padding for `coord_polar(transofrm_bkgr=False)` otherwise it behaves like a margin around the panel.
252
+ Inset for a panel. The inset behaves like a padding for `coord_polar(transform_bkgr=False)` otherwise it behaves like a margin around the panel.
250
253
  The inset may be specified using a number or a list of numbers:
251
254
 
252
- - a number or list of one number - the same inset it applied to all four sides;
255
+ - a number or list of one number - the same inset is applied to all four sides;
253
256
  - a list of two numbers - the first inset applies to the top and bottom, the second - to the left and right;
254
257
  - a list of three numbers - the first inset applies to the top, the second - to the right and left, the third - to the bottom;
255
258
  - a list of four numbers - the insets are applied to the top, right, bottom and left in that order.
256
259
 
257
- It is acceptable to use None for any side; in this case, the default value for the plot inset side will be used.
260
+ It is acceptable to use None for any side; in this case, the default value for the panel inset side will be used.
258
261
  panel_grid_ontop, panel_grid_ontop_x, panel_grid_ontop_y : bool, default=False
259
262
  Option to place major grid lines and minor grid lines over the data layers.
260
263
  plot_background : str or dict
261
- Background of the entire plot.
264
+ Style settings for overall plot background.
262
265
  Set 'blank' or result of `element_blank()` to draw nothing.
263
266
  Set `element_rect()` to specify plot background parameters, inherited from `rect`.
264
267
  plot_title : str or dict
265
- Plot title.
268
+ Style settings for plot title.
266
269
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
267
270
  Set `element_text()` to specify plot title parameters, inherited from `title`.
268
271
  plot_subtitle : str or dict
269
- Plot subtitle.
272
+ Style settings for plot subtitle.
270
273
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
271
274
  Set `element_text()` to specify plot subtitle parameters, inherited from `plot_title` or `title`.
272
275
  plot_caption : str or dict
273
- Plot caption.
276
+ Style settings for plot caption.
274
277
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
275
278
  Set `element_text()` to specify plot caption parameters, inherited from `title`.
276
279
  plot_message : str or dict
277
- Plot message (e.g. sampling messages).
280
+ Style settings for plot message (e.g. sampling messages).
278
281
  Set 'blank' or result of `element_blank()` to show nothing.
279
282
  Set `element_text()` to show sampling messages (`element_text()` options don't affect a message text).
280
283
  plot_margin : number or list of numbers
281
284
  Margin around entire plot.
282
285
  The margin may be specified using a number or a list of numbers:
283
286
 
284
- - a number or list of one number - the same margin it applied to all four sides;
287
+ - a number or list of one number - the same margin is applied to all four sides;
285
288
  - a list of two numbers - the first margin applies to the top and bottom, the second - to the left and right;
286
289
  - a list of three numbers - the first margin applies to the top, the second - to the right and left, the third - to the bottom;
287
290
  - a list of four numbers - the margins are applied to the top, right, bottom and left in that order.
@@ -291,7 +294,7 @@ def theme(*,
291
294
  Inset for a plotting area, including the axes with their labels, but without titles.
292
295
  The inset may be specified using a number or a list of numbers:
293
296
 
294
- - a number or list of one number - the same inset it applied to all four sides;
297
+ - a number or list of one number - the same inset is applied to all four sides;
295
298
  - a list of two numbers - the first inset applies to the top and bottom, the second - to the left and right;
296
299
  - a list of three numbers - the first inset applies to the top, the second - to the right and left, the third - to the bottom;
297
300
  - a list of four numbers - the insets are applied to the top, right, bottom and left in that order.
@@ -306,55 +309,55 @@ def theme(*,
306
309
  A value of 'panel' means that caption is aligned to the plot panels.
307
310
  A value of 'plot' means that caption is aligned to the entire plot (excluding margins).
308
311
  strip_background : str or dict
309
- Background of facet labels.
312
+ Style settings for facet strip background.
310
313
  Set 'blank' or result of `element_blank()` to draw nothing.
311
314
  Set `element_rect()` to specify facet label background parameters, inherited from `rect`.
312
315
  strip_background_x : str or dict
313
- Horizontal facet background.
316
+ Style settings for horizontal facet background.
314
317
  Set 'blank' or result of `element_blank()` to draw nothing.
315
318
  Set `element_rect()` to specify facet label background parameters, inherited from `strip_background`.
316
319
  strip_background_y : str or dict
317
- Vertical facet background.
320
+ Style settings for vertical facet background.
318
321
  Set 'blank' or result of `element_blank()` to draw nothing.
319
322
  Set `element_rect()` to specify facet label background parameters, inherited from `strip_background`.
320
323
  strip_text : str or dict
321
- Facet labels.
324
+ Style settings for facet labels.
322
325
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
323
326
  Set `element_text()` to specify facet label parameters, inherited from `text`.
324
327
  strip_text_x : str or dict
325
- Horizontal facet labels.
328
+ Style settings for horizontal facet labels.
326
329
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
327
330
  Set `element_text()` to specify facet label parameters, inherited from `strip_text`.
328
331
  strip_text_y : str or dict
329
- Vertical facet labels.
332
+ Style settings for vertical facet labels.
330
333
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
331
334
  Set `element_text()` to specify facet label parameters, inherited from `strip_text`.
332
335
  axis_tooltip, axis_tooltip_x, axis_tooltip_y : str or dict
333
- Axes tooltips.
336
+ Style settings for axes tooltips.
334
337
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
335
338
  Set `element_rect()` to specify axes tooltip parameters.
336
339
  `axis_tooltip_*` inherits from `axis_tooltip` which inherits from `rect`.
337
340
  axis_tooltip_text, axis_tooltip_text_x, axis_tooltip_text_y : str or dict
338
- Text in axes tooltips.
341
+ Style settings for text in axes tooltips.
339
342
  Set 'blank' or result of `element_blank()` to draw nothing and assign no space.
340
343
  Set `element_text()` to specify axes text tooltip parameters.
341
344
  `axis_tooltip_text_*` inherits from `axis_tooltip_text` which inherits from `tooltip_text`.
342
345
  tooltip : str or dict
343
- General tooltip.
346
+ Style settings for general tooltip.
344
347
  Set 'blank' or result of `element_blank()` to hide the tooltip (also hides side tooltips).
345
348
  Set `element_rect()` to specify tooltip rectangular parameters, inherited from `rect`.
346
349
  tooltip_text : str or dict
347
- Text in general tooltip.
350
+ Style settings for text in general tooltip.
348
351
  Set `element_text()` to specify tooltip text parameters.
349
352
  tooltip_title_text : str or dict
350
- Tooltip title text.
353
+ Style settings for tooltip title text.
351
354
  Set `element_text()` to specify tooltip title parameters, inherited from `tooltip_text`. Bold by default.
352
- label_text : str or dict
353
- Annotation text.
354
- Annotations are currently supported for pie and bar charts.
355
+ label_text : dict
356
+ Style settings for annotation text.
357
+ Annotations are currently supported for pie, bar chart and crossbar.
355
358
  Set `element_text()` to specify annotation text parameters: font family and face, text size, text color.
356
359
  geom : dict
357
- Geometry colors.
360
+ Color settings for geometries.
358
361
  Set `element_geom()` to specify new values for the named colors.
359
362
 
360
363
  Returns
@@ -573,7 +576,7 @@ def element_text(
573
576
  ) -> dict:
574
577
  """
575
578
  Specify how non-data components of the plot are drawn.
576
- This theme element draws texts.
579
+ This theme element draws text.
577
580
 
578
581
  Parameters
579
582
  ----------
@@ -592,18 +595,18 @@ def element_text(
592
595
  0 - left-justified;
593
596
  1 - right-justified;
594
597
  0.5 - center-justified.
595
- Can be used with values out of range, but behaviour is not specified.
598
+ Values outside the [0, 1] range are allowed but may produce unpredictable results.
596
599
  vjust : float
597
600
  Vertical justification (in [0, 1]).
598
601
  0 - bottom-justified;
599
602
  1 - top-justified;
600
603
  0.5 - middle-justified.
601
- Can be used with values out of range, but behaviour is not specified.
604
+ Values outside the [0, 1] range are allowed but may produce unpredictable results.
602
605
  margin : number or list of numbers
603
606
  Margins around the text.
604
607
  The margin may be specified using a number or a list of numbers:
605
608
 
606
- - a number or list of one number - the same margin it applied to all four sides;
609
+ - a number or list of one number - the same margin is applied to all four sides;
607
610
  - a list of two numbers - the first margin applies to the top and bottom, the second - to the left and right;
608
611
  - a list of three numbers - the first margin applies to the top, the second - to the right and left, the third - to the bottom;
609
612
  - a list of four numbers - the margins are applied to the top, right, bottom and left in that order.
@@ -629,7 +632,7 @@ def element_text(
629
632
  np.random.seed(42)
630
633
  data = {'x': np.random.normal(size=1000)}
631
634
  ggplot(data, aes(x='x')) + geom_histogram() + \\
632
- theme(axis_text=element_text(color='#cb181d', face='bold_italic', margin=[5, 10]))
635
+ theme(axis_text=element_text(color='#cb181d', face='bold_italic'))
633
636
 
634
637
  """
635
638
  return locals()
@@ -649,7 +652,7 @@ def element_markdown(
649
652
  ) -> dict:
650
653
  """
651
654
  Specify how non-data components of the plot are drawn.
652
- This theme element draws texts with Markdown support.
655
+ This theme element draws text with Markdown support.
653
656
 
654
657
  Parameters
655
658
  ----------
@@ -679,7 +682,7 @@ def element_markdown(
679
682
  Margins around the text.
680
683
  The margin may be specified using a number or a list of numbers:
681
684
 
682
- - a number or list of one number - the same margin it applied to all four sides;
685
+ - a number or list of one number - the same margin is applied to all four sides;
683
686
  - a list of two numbers - the first margin applies to the top and bottom, the second - to the left and right;
684
687
  - a list of three numbers - the first margin applies to the top, the second - to the right and left, the third - to the bottom;
685
688
  - a list of four numbers - the margins are applied to the top, right, bottom and left in that order.
@@ -735,7 +738,7 @@ def element_geom(
735
738
  # ToDo: fatten
736
739
  ) -> dict:
737
740
  """
738
- Specify new values for the named colors.
741
+ Specify custom values for named geom colors used in plot elements.
739
742
 
740
743
  Parameters
741
744
  ----------
lets_plot/plot/util.py CHANGED
@@ -8,7 +8,7 @@ from lets_plot._type_utils import is_pandas_data_frame
8
8
  from lets_plot.geo_data_internals.utils import find_geo_names
9
9
  from lets_plot.mapping import MappingMeta
10
10
  from lets_plot.plot.core import aes, FeatureSpec
11
- from lets_plot.plot.series_meta import infer_type, TYPE_UNKNOWN
11
+ from lets_plot.plot.series_meta import _infer_type, TYPE_UNKNOWN, TYPE_DATE_TIME, _detect_time_zone
12
12
 
13
13
 
14
14
  def as_boolean(val, *, default):
@@ -26,10 +26,10 @@ def as_annotated_data(data: Any, mapping_spec: FeatureSpec) -> Tuple:
26
26
  # fill mapping_meta_by_var, mappings and data_type_by_var.
27
27
  if mapping_spec is not None:
28
28
  for key, spec in mapping_spec.props().items():
29
- # key is either an aesthetic name or 'name' (FeatureSpec.name property)
29
+ # the key is either an aesthetic name or 'name' (FeatureSpec.name property)
30
30
  if key == 'name': # ignore FeatureSpec.name property
31
31
  continue
32
-
32
+
33
33
  if isinstance(spec, MappingMeta):
34
34
  mappings[key] = spec.variable
35
35
  mapping_meta_by_var.setdefault(spec.variable, {})[key] = spec
@@ -37,7 +37,15 @@ def as_annotated_data(data: Any, mapping_spec: FeatureSpec) -> Tuple:
37
37
  else:
38
38
  mappings[key] = spec # spec is a variable name
39
39
 
40
- data_type_by_var.update(infer_type(data))
40
+ data_type_by_var.update(_infer_type(data))
41
+
42
+ # Detect the tome zone - one for the entire data set.
43
+ time_zone_by_var_name = {}
44
+ for var_name, data_type in data_type_by_var.items():
45
+ if data_type == TYPE_DATE_TIME:
46
+ time_zone = _detect_time_zone(var_name, data)
47
+ if time_zone is not None:
48
+ time_zone_by_var_name[var_name] = time_zone
41
49
 
42
50
  # fill series annotations
43
51
  series_annotations = {} # var to series_annotation
@@ -47,6 +55,9 @@ def as_annotated_data(data: Any, mapping_spec: FeatureSpec) -> Tuple:
47
55
  if data_type != TYPE_UNKNOWN:
48
56
  series_annotation['type'] = data_type
49
57
 
58
+ if var_name in time_zone_by_var_name:
59
+ series_annotation['time_zone'] = time_zone_by_var_name[var_name]
60
+
50
61
  if is_pandas_data_frame(data) and data[var_name].dtype.name == 'category' and data[var_name].dtype.ordered:
51
62
  series_annotation['factor_levels'] = data[var_name].cat.categories.to_list()
52
63
  elif var_name in mapping_meta_by_var:
lets_plot/tilesets.py CHANGED
@@ -140,7 +140,6 @@ def _carto_tiles(tileset, cdn):
140
140
  if cdn == 'carto':
141
141
  base_url = "https://{{s}}.basemaps.cartocdn.com/rastertiles/{tileset}/{{z}}/{{x}}/{{y}}{hi_res}.png"
142
142
  elif cdn == 'fastly':
143
- # TODO: remove this branch in future releases
144
143
  base_url = "https://cartocdn_{{s}}.global.ssl.fastly.net/{tileset}/{{z}}/{{x}}/{{y}}{hi_res}.png"
145
144
  else:
146
145
  raise ValueError("Unknown carto cdn: {}. Expected 'carto' or 'fastly'.".format(cdn))
@@ -268,19 +267,85 @@ Examples
268
267
 
269
268
  CARTO_MIDNIGHT_COMMANDER, CARTO_MIDNIGHT_COMMANDER_HIRES = _carto_tiles('base-midnight', cdn='fastly')
270
269
  """
271
- The tileset is deprecated and will be removed in future releases.
270
+ CARTO tiles, midnight commander theme.
271
+
272
+ Examples
273
+ --------
274
+ .. jupyter-execute::
275
+ :linenos:
276
+ :emphasize-lines: 4
277
+
278
+ from lets_plot import *
279
+ from lets_plot import tilesets
280
+ LetsPlot.setup_html()
281
+ ggplot() + geom_livemap(tiles=tilesets.CARTO_MIDNIGHT_COMMANDER)
282
+
283
+ |
284
+
285
+ .. jupyter-execute::
286
+ :linenos:
287
+ :emphasize-lines: 4
288
+
289
+ from lets_plot import *
290
+ from lets_plot import tilesets
291
+ LetsPlot.setup_html()
292
+ ggplot() + geom_livemap(tiles=tilesets.CARTO_MIDNIGHT_COMMANDER_HIRES)
272
293
 
273
294
  """
274
295
 
275
296
  CARTO_ANTIQUE, CARTO_ANTIQUE_HIRES = _carto_tiles('base-antique', cdn='fastly')
276
297
  """
277
- The tileset is deprecated and will be removed in future releases.
298
+ CARTO tiles, antique theme.
299
+
300
+ Examples
301
+ --------
302
+ .. jupyter-execute::
303
+ :linenos:
304
+ :emphasize-lines: 4
305
+
306
+ from lets_plot import *
307
+ from lets_plot import tilesets
308
+ LetsPlot.setup_html()
309
+ ggplot() + geom_livemap(tiles=tilesets.CARTO_ANTIQUE)
310
+
311
+ |
312
+
313
+ .. jupyter-execute::
314
+ :linenos:
315
+ :emphasize-lines: 4
316
+
317
+ from lets_plot import *
318
+ from lets_plot import tilesets
319
+ LetsPlot.setup_html()
320
+ ggplot() + geom_livemap(tiles=tilesets.CARTO_ANTIQUE_HIRES)
278
321
 
279
322
  """
280
323
 
281
324
  CARTO_FLAT_BLUE, CARTO_FLAT_BLUE_HIRES = _carto_tiles('base-flatblue', cdn='fastly')
282
325
  """
283
- The tileset is deprecated and will be removed in future releases.
326
+ CARTO tiles, flat blue theme.
327
+
328
+ Examples
329
+ --------
330
+ .. jupyter-execute::
331
+ :linenos:
332
+ :emphasize-lines: 4
333
+
334
+ from lets_plot import *
335
+ from lets_plot import tilesets
336
+ LetsPlot.setup_html()
337
+ ggplot() + geom_livemap(tiles=tilesets.CARTO_FLAT_BLUE)
338
+
339
+ |
340
+
341
+ .. jupyter-execute::
342
+ :linenos:
343
+ :emphasize-lines: 4
344
+
345
+ from lets_plot import *
346
+ from lets_plot import tilesets
347
+ LetsPlot.setup_html()
348
+ ggplot() + geom_livemap(tiles=tilesets.CARTO_FLAT_BLUE_HIRES)
284
349
 
285
350
  """
286
351
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: lets-plot
3
- Version: 4.6.1
3
+ Version: 4.7.0rc1
4
4
  Summary: An open source library for statistical plotting
5
5
  Home-page: https://lets-plot.org
6
6
  Author: JetBrains
@@ -11,9 +11,7 @@ License: MIT
11
11
  Project-URL: Github, https://github.com/JetBrains/lets-plot
12
12
  Project-URL: Documentation, https://lets-plot.org
13
13
  Keywords: ggplot,ggplot2,geospatial,geopandas,geocoding
14
- Classifier: License :: OSI Approved :: MIT License
15
14
  Classifier: Development Status :: 5 - Production/Stable
16
- Classifier: Programming Language :: Python :: 3.8
17
15
  Classifier: Programming Language :: Python :: 3.9
18
16
  Classifier: Programming Language :: Python :: 3.10
19
17
  Classifier: Programming Language :: Python :: 3.11
@@ -29,7 +27,11 @@ Classifier: Topic :: Scientific/Engineering :: Visualization
29
27
  Classifier: Intended Audience :: Science/Research
30
28
  Classifier: Intended Audience :: Developers
31
29
  Description-Content-Type: text/markdown
32
- License-File: ../LICENSE
30
+ License-File: LICENSE
31
+ License-File: licenses/LICENSE.FreeType
32
+ License-File: licenses/LICENSE.ImageMagick
33
+ License-File: licenses/LICENSE.expat
34
+ License-File: licenses/LICENSE.fontconfig
33
35
  Requires-Dist: pypng
34
36
  Requires-Dist: palettable
35
37
  Dynamic: author
@@ -40,6 +42,7 @@ Dynamic: description-content-type
40
42
  Dynamic: home-page
41
43
  Dynamic: keywords
42
44
  Dynamic: license
45
+ Dynamic: license-file
43
46
  Dynamic: maintainer
44
47
  Dynamic: maintainer-email
45
48
  Dynamic: project-url
@@ -126,6 +129,10 @@ Also read:
126
129
 
127
130
  See [example notebook](https://nbviewer.org/github/JetBrains/lets-plot/blob/master/docs/f-25a/ggbunch_indonesia.ipynb).
128
131
 
132
+ <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-25a/images/magnifier_inset.png" alt="f-25a/images/magnifier_inset.png" width="400" height="251">
133
+
134
+ See [example notebook](https://nbviewer.org/github/JetBrains/lets-plot/blob/master/docs/f-25a/magnifier_inset.ipynb).
135
+
129
136
  - #### Parameters `start` and `direction` in `geom_pie()` Geometry
130
137
  <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-25a/images/geom_pie_params.png" alt="f-25a/images/geom_pie_params.png" width="400" height="119">
131
138
 
@@ -139,6 +146,21 @@ Also read:
139
146
 
140
147
  ## Recent Updates in the [Gallery](https://lets-plot.org/python/pages/gallery.html)
141
148
 
149
+ <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/magnifier_inset.ipynb">
150
+ <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-25a/images/magnifier_inset.png" alt="f-25a/images/magnifier_inset.png" width="128" height="128">
151
+ </a>
152
+ <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/ggbunch_indonesia.ipynb">
153
+ <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-25a/images/ggbunch_indonesia.png" alt="f-25a/images/ggbunch_indonesia.png" width="128" height="128">
154
+ </a>
155
+ <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/theme_legend_scheme.ipynb">
156
+ <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24g/images/theme_legend_scheme.png" alt="f-24g/images/theme_legend_scheme.png" width="128" height="128">
157
+ </a>
158
+ <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/interact_pan_zoom.ipynb">
159
+ <img src="https://github.com/JetBrains/lets-plot-docs/blob/4b9571b8af759574fa2db313a102069d8f8c7238/source/_static/images/changelog/4.5.0/interact_pan_zoom.png?raw=true" alt="images/changelog/4.5.0/interact_pan_zoom.png" width="128" height="128">
160
+ </a>
161
+ <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/lp_verse.ipynb">
162
+ <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24g/images/lp_verse.png" alt="f-24g/images/lp_verse.png" width="128" height="128">
163
+ </a>
142
164
  <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/us_unemployment.ipynb">
143
165
  <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24e/images/us_unemployment.png" alt="f-24e/images/us_unemployment.png" width="128" height="128">
144
166
  </a>
@@ -154,21 +176,7 @@ Also read:
154
176
  <a href="https://www.kaggle.com/code/alshan/japanese-volcanoes-on-map">
155
177
  <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24b/images/gal_japanese_volcanoes_on_map.png" alt="f-24b/images/gal_japanese_volcanoes_on_map.png" width="128" height="128">
156
178
  </a>
157
- <a href="https://nextjournal.com/asmirnov-horis/bbc-visual-and-data-journalism-cookbook-for-lets-plot">
158
- <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24a/images/gal_bbc_cookbook.png" alt="f-24a/images/gal_bbc_cookbook.png" width="128" height="128">
159
- </a>
160
- <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/palmer_penguins.ipynb">
161
- <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24a/images/gal_penguins.png" alt="f-24a/images/gal_penguins.png" width="128" height="128">
162
- </a>
163
- <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/periodic_table.ipynb">
164
- <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24a/images/gal_periodic_table.png" alt="f-24a/images/gal_periodic_table.png" width="128" height="128">
165
- </a>
166
- <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/wind_rose.ipynb">
167
- <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24a/images/gal_wind_rose.png" alt="f-24a/images/gal_wind_rose.png" width="128" height="128">
168
- </a>
169
- <a href="https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/demo/heatmap_in_polar_coord.ipynb">
170
- <img src="https://raw.githubusercontent.com/JetBrains/lets-plot/master/docs/f-24a/images/gal_polar_heatmap.png" alt="f-24a/images/gal_polar_heatmap.png" width="128" height="128">
171
- </a>
179
+
172
180
 
173
181
  ## Change Log
174
182