zero-one-group / fxl Goto Github PK
View Code? Open in Web Editor NEWfxl is a Clojure spreadsheet library
License: Apache License 2.0
fxl is a Clojure spreadsheet library
License: Apache License 2.0
This was another data format from reading the previous dummy-spreadsheet.xslx
but seems like 0.00
does exactly this already. Not sure what is different per se
"0.00_ ;\\-0.00\\ "
Previous was implied by (fact "Font style should be preserved") by removal of font-size 11 since it was a default
but have since changed it as the default font size was changed in 3979812 .
And I think a separate test would reflect better clarity
If you read and write and read a file, the font size will be converted from 12 to 11 (Microsoft Office Excel 2007 uses the Calibri font in font size 11 - https://poi.apache.org/apidocs/dev/org/apache/poi/xssf/usermodel/XSSFFont.html#getFontHeightInPoints--)
Because of prune-cell-style
and the :font-size 12 doesn't get added in the read-xlsx!
. Thus, when you do a read then write, the lack of font-size will change to the apache poi default of 11.
In this case since the true default is 11, should we just change fxl's font-size default from 12 to 11 - if we are keeping prune-cell-style
?
fxl/test/zero_one/fxl/core_test.clj
Line 30 in a2f36e9
Based on some tests, it seems that the colours in the test/resources/dummy-spreadsheet.xslx
are incompatible with .getFillForegroundColor
. Colours are however read correctly from files generated with fxl.
This might be a limitation of org.apache.poi.xssf.usermodel
? Have to see how dummy-spreadsheet.xslx
was created. Proprietary excel issues?
I see an opportunity to shape a dataset into fxl cells. Would the project take on tech.ml.dataset
as a dependency? Perhaps it's best as a utility namespace or other library.
Formula cells currently take cached values and display them as they are
Have a flag to re-evaluate formulas with setForceFormulaRecalculation
https://poi.apache.org/apidocs/dev/org/apache/poi/xssf/usermodel/XSSFSheet.html#setForceFormulaRecalculation-boolean-
Or stuff here https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/FormulaEvaluator.html
Due to #15, a good current solution is to produce a new test/resources/dummy-spreadsheet.xslx
from within fxl. This allows the colours to be read in and tested.
Based on the specifications to support formula cells in #18. I have done a tracer bullet to create a replica of the dummy-spreadsheet.xslx
.
The only part which I am unable to replicate as of now is cell decimal place formatting - such that 2.4247
only appears with 2 d.p. 2.42
. This however, does not seem to be supported in fxl as of now anyway, so it seems like it could be ignored for now
Basically reading a file
should produce the same output as that of reading-writing-reading again
(let [cell (list (fxl/->cell {:coord {:row 0 :col 0}}))]
(fxl/concat-right cell cell))
cell has to be wrapped in a list like so to work
I propose we change the spec of a cell to
(s/def ::cell
(s/keys :req-un [::value ::coord ::style ::formula]))
this seems like it would be inline with the underlining Apache POI (Java API)
https://poi.apache.org/apidocs/4.1/org/apache/poi/ss/usermodel/CellBase.html#setCellFormula-java.lang.String-
as setCellFormula
and setCellValue
are on the same level
This seems to be the simpler implementation, as the underlying logic of the code does not really change. It will just be an inclusion of :formula nil
in the hashmap
We will however need to make changes to
core.clj (helper functions
spec.clj (include ::formula
definition and add to ::cell
)
defaults.clj (add :formula
to be included in defaults
read_xlsx.clj
write_xlsx.clj
many tests
Hi, I'm loving this approach to building spreadsheets in Clojure. I'm wondering if support for using arbitrary colours in cell styles is planned as the current colour selection is fairly limited. Being able to use RGB hex codes (or any other representation) would be great.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.