Comments (2)
Currently this is the expected behaviour, but I think you're right we should change the behaviour.
There's two different things here:
- when you set
Page.path
, it's correct that we convert whitespace to-
to make a clean valid URL for the page - when you set
Card.href
, remember this can be a link to anything, not just a link inside your app. Hence it's valid to put in e.g.Card.href = "http://www.example.com/something with space"
(space is not a valid character in a URL and it should be encoded as%20
, but this encoding always happens automatically when you click the link so there's not really any point us doing it I think. Even if we did encode it, we should not convert spaces to-
because it would contradict the correct HTML encoding of%20
)
The case you give here is a special (but common) case where you use Card.href
to refer to a page in the app and hence use a relative link. We handle this as:
href=get_relative_path(self.href) if self.href.startswith("/") else self.href
I think we should change this:
- put
self.href
through the sameclean_path
transformation thatPage.path
has in the case that it's a relative path. Hence writingCard.href = "/page page"
would then work - even better, make it so that you can just write
Card.href = "page page"
without the leading/
and it would still work. This would mean we need a better check to see if thehref
is relative or absolute and to add the/
back in the case that it's not absolute and it's missing
This way a user will be able to put the page title directly in the Card.href
without thinking about it even if it's got weird characters, i.e. this should work:
Page(title = "something weird %*")
Card(href = "something weird %*")
from vizro.
After more thought we should not implement this feature for now. See #348 for explanation.
from vizro.
Related Issues (20)
- Decimal numbers are sometimes being cut-off in sliders/range-sliders HOT 2
- Custom actions do not work when applied through a component that gets added to a union such as `ControlType`
- Create an example dashboard for novice/intermediate/advanced users
- Restyle the documentation landing page
- Add documentation about the demo example and clean up `examples`
- Revise the graphics used in README for `vizro-ai` and `vizro-core` so they render better in PyPI
- CSS of AG Grid `floatingFilter` option buggy HOT 1
- AgGrid doesn't work with `persistence` props HOT 2
- Add a tabbed navigation to move between `vizro-core` and `vizro-ai` docs HOT 1
- Can I add an icon to a button HOT 2
- Check all links in docs and make them more accessible HOT 15
- Enabling in-depth user interaction through input widgets HOT 7
- typo in explore-components/#22-add-further-components HOT 1
- False negative on hatch run test inside container environment HOT 3
- Custom AG Grid function overwrites pandas.DataFrame provided as input with an empty pandas.DataFrame HOT 2
- __call__ function within models/_components/graphy.py passing parent function kwargs unintentionally HOT 11
- Minor typo in "Explore Vizro" tutorial HOT 1
- Contribution guidelines link leads to `404` HOT 1
- Relationship analysis chart in demo has no flexibility in Y axis HOT 5
- Multiple Series Line Chart Updates HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vizro.