Comments (5)
Done in #25 -- thank you for your suggestion!
from obsidian-sortable.
Hi,
Thank you for reporting this issue.
Currently, the plugin only sorts numeric and string data types (without assuming any other info).
I will add natural file sorting to the roadmap.
-- Alex
from obsidian-sortable.
Sure.
But, the thing with using Intl.Collator
is that you won't need to specify whether the content is text or number; it can sort naturally on its own.
const collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
<arrayOfObjects>.sort((a, b) => collator.compare(a.something, b.something))
Here, you don't need to check whether the contents of the table cell were text, path, or number.
So, instead of roadmap, could it be kindly implemented immediately?
from obsidian-sortable.
from obsidian-sortable.
Here, you don't need to check whether the contents of the table cell were text, path, or number.
It appears that the data type still matters:
let xs = [1, 2, -5, 3, 1e100, -1e100];
const c = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
console.log(xs.sort(c.compare))
// > Array [-1e+100, -5, 1, 1e+100, 2, 3]
so I will only use the collator for strings.
from obsidian-sortable.
Related Issues (20)
- Remove table state on pane close (or similar) HOT 1
- Sorting by Date-and-Time columns does not change the order - only reverts to original order HOT 10
- Implement parsers for various data types + auto-detect data type
- Submitting Sortable to Community Plugins HOT 4
- Exclude dataview calendar HOT 5
- Issues with installation HOT 3
- Feature request: Live Preview support HOT 11
- Feature Request: Row Filter HOT 2
- Can't sort according to dates HOT 3
- Live Preview support for native (non-dataview) tables HOT 2
- Sortable in alphabet not date HOT 1
- Unable to sort list of IP Addresses HOT 1
- Hide sort button when there's only table headers/no table content HOT 3
- Sorting by date is flawed HOT 1
- Does not work on a secondary window. HOT 3
- Incorrect MAC addresses sorting HOT 3
- Add comprehensive testing suite
- Sorting is reset to the unsorted state when dataview content is updated HOT 2
- Feature Request: have Sortable ignore tables inside of special class
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 obsidian-sortable.