Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Re-add support for passingtitle as string#7230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
emilykl wants to merge6 commits intomasterfromsupport-title-string

Conversation

@emilykl
Copy link
Contributor

@emilyklemilykl commentedOct 17, 2024
edited
Loading

].join(' ')
}
},
_deprecated:{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

How about dropping thedeprecation here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hmm.. I see then it would collide with the the title which is declared as an object.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think the best way of handing these cases today is to change the titlevalType to beany and then support bothString andObject types so that whentitle is a stringtitle.text is set to the string.
How about opening a new PR with this approach?

Copy link
ContributorAuthor

@emilyklemilyklOct 17, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@archmoj That sounds fine but I'm unsure about theattributes syntax for accepting both an object (with specific nested keys) and a string... this is the attribute definition right now fortitle in colorbar:

    title: {        text: {            valType: 'string',            description: 'Sets the title of the color bar.'        },        font: fontAttrs({            description: 'Sets this color bar\'s title font.'        }),        side: {            valType: 'enumerated',            values: ['right', 'top', 'bottom'],            description: [                'Determines the location of color bar\'s title',                'with respect to the color bar.',                'Defaults to *top* when `orientation` if *v* and ',                'defaults to *right* when `orientation` if *h*.',            ].join(' ')        }    },

My point is that there doesn't seem to be a place to definevalType fortitle if we are also defining nested attributes undertitle. Do you have a suggestion?

Copy link
Contributor

@archmojarchmojOct 17, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Let's see what@alexcjohnson would suggest here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

How about keeping thevalType asObject with and add anextra option for this case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Or perhaps we should just handle this String option on the plotly.py side?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@archmoj Do you have an example of anextra option being used elsewhere in the codebase?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Something like this:https://github.com/plotly/plotly.js/pull/6990/files#r1591049384
Instead ofextra you may add another option to coerce and name itstringOk or something else.

@archmoj
Copy link
Contributor

We should possibly support this option on places e.g.legend.title. No?

@emilykl
Copy link
ContributorAuthor

We should possibly support this option on places e.g.legend.title. No?

Agreed, it makes sense to be consistent, I'll look into how much work this would be.

@gvwilsongvwilson added P1needed for current cycle fixfixes something broken labelsNov 5, 2024
@archmoj
Copy link
Contributor

Revised in#7262.

@archmojarchmoj closed thisNov 5, 2024
@archmojarchmoj deleted the support-title-string branchNovember 5, 2024 17:30
Comment on lines +631 to +647
},
{
desc:'despite passing title only as a string (backwards-compatibility)',
update:{
title:NEW_TITLE,
xaxis:{title:NEW_XTITLE},
yaxis:{title:NEW_YTITLE}
}
},
{
desc:'despite passing title only as a string using string attributes '+
'(backwards-compatibility)',
update:{
title:NEW_TITLE,
'xaxis.title':NEW_XTITLE,
'yaxis.title':NEW_YTITLE
}
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@archmoj These tests should also be included in#7262 , right?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alexcjohnsonalexcjohnsonAwaiting requested review from alexcjohnson

@ndreznndreznAwaiting requested review from ndrezn

@LiamConnorsLiamConnorsAwaiting requested review from LiamConnors

@marthacryanmarthacryanAwaiting requested review from marthacryan

@gvwilsongvwilsonAwaiting requested review from gvwilson

1 more reviewer

@archmojarchmojarchmoj left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

fixfixes something brokenP1needed for current cycle

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@emilykl@archmoj@gvwilson

[8]ページ先頭

©2009-2025 Movatter.jp