xou/elixlsx 190
An Elixir XLSX writer
a minimal STL containers to JSON converter in C++
Wikipedia page graph queries from RAM
A python wrapper for Alpha Vantage API for financial data.
an Android app for creating and modifying OSC-compatible templates
Talk idea and scheduling + record of past talk resources.
Toy biginteger library in C++
Set your wallpaper to the bing.com background
Project for EDAMI at PW
startedHappy0/ssb-chess-data-access
started time in 17 hours
starteddandavison/delta
started time in 18 hours
startednushell/nushell
started time in 4 days
startedxou/elixlsx
started time in 5 days
startedssb-ngi-pointer/ssb-replication-scheduler
started time in 5 days
Pull request review commentxou/elixlsx
sheet6 = # nest further |> Sheet.group_cols("C", "D") ++# Autofilter can be applied to allow filtering a range+sheet7 =+ %Sheet{+ name: "Autofilter columns",+ rows: [+ [1, 2, 3],+ [4, 5, 6],+ [7, 8, 9],+ [10, 11, 12],+ [13, 14, 15],+ ]+ }+ # first you select the filtering range
First of all, I would like to clear up a misconception. An autofilter does not apply to a single column, but a range. E.g. assume you have names, postal codes, and adresses in column A, B, and C respectively. Then a filtering based on say a postal code applies to all three columns, if they are all selected as the filtering range.
Next, to answer your question. In Excel if you create a filtering range without selecting any filter, you will see dropdown carets on each column in the filtering range (for selecting a filter obviously), but with no filter applied yet. No harm done, and it may actually be beneficial, as you might want to generate a worksheet with a filtering range but no filters applied as a convenience for your users.
comment created time in 5 days
Pull request review commentxou/elixlsx
defmodule Elixlsx.Sheet do def remove_pane_freeze(sheet) do %{sheet | pane_freeze: nil} end+++ @spec set_autofilter(Sheet.t(), String.t(), String.t()) :: Sheet.t()+ @doc ~S"""+ Set the range for autofiltering+ """+ def set_autofilter(sheet, start_cell, end_cell) do+ {row1, col1} = Util.from_excel_coords(start_cell)+ {row2, col2} = Util.from_excel_coords(end_cell)+ set_autofilter(sheet, row1, col1, row2, col2)+ end++ @spec set_autofilter(Sheet.t(), number, number, number, number) :: Sheet.t()+ @doc ~S"""+ Set the range for autofiltering+ """+ def set_autofilter(sheet, row1, col1, row2, col2) do+ %{sheet | autofilter_ref: {row1, col1, row2, col2}}+ end+++ @spec append_list_filter(Sheet.t(), String.t(), list(any())) :: Sheet.t()+ @doc ~S"""+ Add filter on a column as a list of inclusive elements+ """+ def append_list_filter(sheet, column, filters) when is_binary(column) do+ append_list_filter(sheet, Util.decode_col(column), filters)+ end++ @spec append_list_filter(Sheet.t(), number, list(any())) :: Sheet.t()+ @doc ~S"""+ Add filter on a column as a list of inclusive elements+ """+ def append_list_filter(sheet, column, filters) do+ update_in(sheet.autofilter_cols, &Map.put(&1, column, {:list, filters}))+ end+++ @spec append_criteria_filter(Sheet.t(), String.t(), operator, any()) :: Sheet.t()+ @doc ~S"""+ Add filter on a column as an operator-based criteria
It is documented now.
comment created time in 5 days
Pull request review commentxou/elixlsx
defmodule Elixlsx.XMLTemplates do end end + defp make_autofilter(nil, filter_cols) do+ ""+ end++ defp make_autofilter(autofilter_ref, filter_cols) do+ {row1, col1, row2, col2} = autofilter_ref++ """+ <autoFilter ref="#{Util.to_excel_coords(row1, col1)}:#{Util.to_excel_coords(row2, col2)}">+ """ <>+ make_filter_columns(autofilter_ref, filter_cols) <>+ """+ </autoFilter>+ """+ end++ defp make_filter_columns(autofilter_ref, filter_cols) do+ {_row1, col1, _row2, col2} = autofilter_ref++ Enum.map_join(filter_cols, fn col, {filter_type, filters} ->+ if col < col1 or col > col2 do+ # Filter column out of autofilter range+ ""+ else+ # Filter columns are relative to first column in the autofilter.+ make_filter_column(col - col1, filter_type, filters)+ end+ end)+ end++ defp make_filter_column(col_id, filter_type, filters) do+ """+ <filterColumn colId="#{col_id}">+ """ <>+ if filter_type == :list, do: make_filters(filters), else: make_custom_filters(filters) <>+ """+ </filterColumn>+ """+ end++ defp make_filters(filters) do+ non_blanks = Enum.reject(filters, fn filter -> filter != :blank end)++ blank = length(filters) != length(non_blanks)+ """+ <filters blank="#{blank}">+ """ <>+ Enum.map_join(non_blanks, &make_filter/1)+ """+ </filters>+ """+ end++ defp make_filter({%DateTime{year: year, month: month, day: day, hour: hour, minute: minute, second: second} = date, grouping}) do+ """+ <dateGroupItem year="#{year}" month="#{month}" day="#{day}" hour="#{hour}" minute="#{minute}" second="#{second}" dateTimeGrouping="#{grouping}"/>+ """+ end++ defp make_filter(val) do+ "<filter val=\"#{val}\"/>"+ end++ def make_custom_filters(expr) do
It most definitely should. I have fixed it now.
comment created time in 5 days
created repositorynumba/linux-32-numpy-conda-package-via-pip-master
Linux-32 NumPy Conda Package via pip
created time in 6 days
startedvector-im/element-web
started time in 11 days
startedxou/elixlsx
started time in 15 days
startedHappy0/ssb-chess-mithril
started time in 15 days
created repositoryssb-ngi-pointer/go-metafeed
A go implementation of the metafeed format spec
created time in 17 days
startedfuzeman/bencode.py
started time in 17 days
startedssb-ngi-pointer/ssb-binary-field-encodings
started time in 17 days
startedzeebo/bencode
started time in 18 days
starteddyne/reflow-crypto
started time in 18 days
created repositoryssb-ngi-pointer/go-bipf
binary in-place format implemented in Go
created time in 18 days
startedHappy0/ssb-chess-index
started time in 20 days
startedelixir-desktop/desktop
started time in 22 days
startedshankardevy/mango
started time in 22 days
startedssbc/systrayhelper
started time in 23 days