svelte-plots-basic 2.2.0 → 2.2.2

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/2d/Axes.svelte +13 -13
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "svelte-plots-basic",
3
3
  "description": "Svelte components for creating simple plots",
4
- "version": "2.2.0",
4
+ "version": "2.2.2",
5
5
  "author": "Sergey Kucheryavskiy",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -312,23 +312,23 @@
312
312
 
313
313
  </script>
314
314
 
315
- <div class="plot-container {'plot_' + $scale}" bind:this={plotElement} class:plot_error={!$isOk}>
315
+ <div class="plot-container" bind:this={plotElement} class:plot_error={!$isOk}>
316
316
 
317
317
  <svg class="plot" bind:this={plotElement} xmlns="http://www.w3.org/2000/svg"
318
318
  style={`font-family: Arial, Helvetica, sans-serif;font-size:${fontSize}px`}>
319
319
 
320
320
  <g style={lblStyleStr}>
321
- <!-- x-axis label -->
322
- {#if xLabel && xLabel !== ''}
323
- <text x={0} y={(height + top) /2} dx={0} dy={0} transform={`rotate(-90, 10, ${height/2})`} style="font-size:1.1em;">{@html yLabel}</text>
324
- {/if}
325
321
  <!-- y-axis label -->
326
322
  {#if yLabel && yLabel !== ''}
327
- <text x={left + width/2 } y={height + top} dx={0} dy={5} style="font-size:1.1em;">{@html xLabel}</text>
323
+ <text x={0} y={(height + top) /2} dx={0} dy={0} transform={`rotate(-90, 10, ${height/2})`} style="font-size:1.1em;">{@html yLabel}</text>
324
+ {/if}
325
+ <!-- x-axis label -->
326
+ {#if xLabel && xLabel !== ''}
327
+ <text x={left + width/2 } y={height + top} dx={0} dy={5} alignment-baseline="hanging" style="font-size:1.1em;">{@html xLabel}</text>
328
328
  {/if}
329
329
  <!-- plot title -->
330
330
  {#if title && title !== ''}
331
- <text x={left + width/2 } y={0} dx={0} dy={0} alignment-baseline="hanging" style="font-size:1.2em;">{@html title}</text>
331
+ <text x={left + width/2 } y={0} dx={0} dy={10} alignment-baseline="hanging" style="font-size:1.2em;">{@html title}</text>
332
332
  {/if}
333
333
  </g>
334
334
 
@@ -370,6 +370,7 @@
370
370
  .plot-container {
371
371
  font-family: Arial, Helvetica, sans-serif;
372
372
  box-sizing: border-box;
373
+ position: relative;
373
374
  min-width: 100px;
374
375
  min-height: 50px;
375
376
  width: 100%;
@@ -398,15 +399,14 @@
398
399
  display: block;
399
400
  box-sizing: border-box;
400
401
  position:absolute;
401
-
402
402
  padding: 0;
403
403
  margin: 0;
404
- height: 100%;
404
+ left: 0;
405
+ top: 0;
406
+ bottom: 0;
407
+ right: 0;
405
408
  width: 100%;
406
- max-height: 100%;
407
- max-width: 100%;
408
- min-height: 100%;
409
- min-width: 100%;
409
+ height: 100%;
410
410
  }
411
411
 
412
412
  .axes-content {