Skip to content

Commit 28ff6e4

Browse files
committed
change function name to isVisibleGivenCustomConfig
1 parent 4787e25 commit 28ff6e4

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

src/components/containers/PlotlySection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33
import {
44
containerConnectedContextTypes,
55
unpackPlotProps,
6-
validateVisibilityWithCustomConfig,
6+
isVisibleGivenCustomConfig,
77
} from '../../lib';
88

99
export class Section extends Component {
@@ -49,7 +49,7 @@ export default class PlotlySection extends Section {
4949

5050
determineVisibility(nextProps, nextContext) {
5151
const {isVisible} = unpackPlotProps(nextProps, nextContext);
52-
this.sectionVisible = validateVisibilityWithCustomConfig(isVisible, nextProps, nextContext);
52+
this.sectionVisible = isVisibleGivenCustomConfig(isVisible, nextProps, nextContext);
5353

5454
React.Children.forEach(nextProps.children, child => {
5555
if (!child || this.sectionVisible) {
@@ -62,7 +62,7 @@ export default class PlotlySection extends Section {
6262
child.type.modifyPlotProps(child.props, nextContext, plotProps);
6363
}
6464

65-
this.sectionVisible = validateVisibilityWithCustomConfig(
65+
this.sectionVisible = isVisibleGivenCustomConfig(
6666
this.sectionVisible || plotProps.isVisible,
6767
child.props,
6868
nextContext,

src/lib/connectToContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {Component} from 'react';
22
import PropTypes from 'prop-types';
3-
import unpackPlotProps, {validateVisibilityWithCustomConfig} from './unpackPlotProps';
3+
import unpackPlotProps, {isVisibleGivenCustomConfig} from './unpackPlotProps';
44
import {getDisplayName} from '../lib';
55

66
export const containerConnectedContextTypes = {
@@ -68,7 +68,7 @@ export default function connectToContainer(WrappedComponent, config = {}) {
6868
WrappedComponent && WrappedComponent.displayName ? WrappedComponent.displayName : null;
6969

7070
if (
71-
validateVisibilityWithCustomConfig(
71+
isVisibleGivenCustomConfig(
7272
props.isVisible,
7373
props,
7474
this.context,

src/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import tinyColor from 'tinycolor2';
2626
import unpackPlotProps, {
2727
computeCustomConfigVisibility,
2828
hasValidCustomConfigVisibilityRules,
29-
validateVisibilityWithCustomConfig,
29+
isVisibleGivenCustomConfig,
3030
} from './unpackPlotProps';
3131
import walkObject, {isPlainObject} from './walkObject';
3232
import {traceTypeToPlotlyInitFigure, plotlyTraceToCustomTrace} from './customTraceType';
@@ -267,6 +267,6 @@ export {
267267
transpose,
268268
unpackPlotProps,
269269
upperCase,
270-
validateVisibilityWithCustomConfig,
270+
isVisibleGivenCustomConfig,
271271
walkObject,
272272
};

src/lib/unpackPlotProps.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,7 @@ export function computeCustomConfigVisibility(props, customConfig, wrappedCompon
9191
return isVisible;
9292
}
9393

94-
export function validateVisibilityWithCustomConfig(
95-
initial,
96-
nextProps,
97-
nextContext,
98-
componentDisplayName
99-
) {
94+
export function isVisibleGivenCustomConfig(initial, nextProps, nextContext, componentDisplayName) {
10095
let show = initial;
10196
if (show && nextContext.hasValidCustomConfigVisibilityRules) {
10297
show = computeCustomConfigVisibility(nextProps, nextContext.customConfig, componentDisplayName);

0 commit comments

Comments
 (0)