Skip to content

Commit 30fa595

Browse files
committed
Add always show ticks option
1 parent 3577365 commit 30fa595

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vueplotlib",
3-
"version": "1.11.1",
3+
"version": "1.11.2",
44
"private": false,
55
"scripts": {
66
"serve": "vue-cli-service serve --open ./examples-src/index.js",

src/components/axes/Axis.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ export default {
106106
type: Boolean,
107107
default: true
108108
},
109+
'autoRemoveTicks': {
110+
type: Boolean,
111+
default: true
112+
},
109113
'log': {
110114
type: Boolean,
111115
default: false
@@ -430,13 +434,13 @@ export default {
430434
if(varScale instanceof CategoricalScale) {
431435
if(vm._orientation === ORIENTATIONS.HORIZONTAL) {
432436
const barWidth = vm.pWidth / varScaleDomainFiltered.length;
433-
if(barWidth < textBboxZoomedIn.height) {
437+
if(vm.autoRemoveTicks && barWidth < textBboxZoomedIn.height) {
434438
ticksZoomedIn.selectAll("text")
435439
.remove();
436440
}
437441
} else if(vm._orientation === ORIENTATIONS.VERTICAL) {
438442
const barHeight = vm.pHeight / varScaleDomainFiltered.length;
439-
if(barHeight < textBboxZoomedIn.height) {
443+
if(vm.autoRemoveTicks && barHeight < textBboxZoomedIn.height) {
440444
ticksZoomedIn.selectAll("text")
441445
.remove();
442446
}
@@ -500,7 +504,7 @@ export default {
500504
501505
if(varScale instanceof CategoricalScale) {
502506
const barWidth = vm.pWidth / varScaleDomain.length;
503-
if(barWidth < textBboxZoomedOut.height) {
507+
if(vm.autoRemoveTicks && barWidth < textBboxZoomedOut.height) {
504508
ticksZoomedOut.selectAll("text")
505509
.remove();
506510
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy