@keen.io/data-export
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -6,4 +6,23 @@ # Change Log | ||
# [1.1.0](https://github.com/keen/keen/compare/@keen.io/data-export@1.0.1...@keen.io/data-export@1.1.0) (2021-09-30) | ||
### Features | ||
* 🎸 csv export parsers ([60a1f62](https://github.com/keen/keen/commit/60a1f621a2d6f749aa6a584e56f1a8188c9af6af)) | ||
* 🎸 csv export transforms ([01d69c2](https://github.com/keen/keen/commit/01d69c298ef785ba2f7463f267f77c04a7c09d17)) | ||
* 🎸 data exporter ([2e5bc47](https://github.com/keen/keen/commit/2e5bc4709fd34c9dc5d2841c2cbef9501cba0711)) | ||
* 🎸 export output to csv file ([16d1405](https://github.com/keen/keen/commit/16d1405dcc8a0f04ab2726c14677662da6b7c93d)) | ||
* 🎸 funnel chart export ([8ea490b](https://github.com/keen/keen/commit/8ea490b0c50aa93dd374a0c077575c145dd2dfca)) | ||
* 🎸 funnel csv export ([960dd1b](https://github.com/keen/keen/commit/960dd1b21f9cab86c3c4c8a6069ff03baaeedaf0)) | ||
* 🎸 line / area chart csv transformations ([e72aee6](https://github.com/keen/keen/commit/e72aee64eb111c1f5af386bc51f60b27718c1db0)) | ||
* 🎸 line chart csv export ([dea5886](https://github.com/keen/keen/commit/dea58864a70f980367426964de4a4863b67e2554)) | ||
* 🎸 tranaform heatmap csv ([821f2d9](https://github.com/keen/keen/commit/821f2d9ec3e47955fe41d931036e57988bbb803b)) | ||
## 1.0.1 (2021-01-29) | ||
**Note:** Version bump only for package @keen.io/data-export |
@@ -1,5 +0,2 @@ | ||
export declare const exportToCSV: ({ data, columnDelimiter, lineDelimiter, }: { | ||
data?: Record<string, any>; | ||
columnDelimiter?: string; | ||
lineDelimiter?: string; | ||
}) => string; | ||
import { ExportOutput } from '../types'; | ||
export declare const exportToCSV: (data?: ExportOutput, columnDelimiter?: string, lineDelimiter?: string) => string; |
@@ -1,32 +0,10 @@ | ||
export var exportToCSV = function (_a) { | ||
var _b = _a.data, data = _b === void 0 ? null : _b, _c = _a.columnDelimiter, columnDelimiter = _c === void 0 ? ',' : _c, _d = _a.lineDelimiter, lineDelimiter = _d === void 0 ? '\n' : _d; | ||
var result; | ||
var ctr; | ||
if (data === null || !data.length) { | ||
return null; | ||
} | ||
var keys = Object.keys(data[0]); | ||
result = ''; | ||
result += keys.join(columnDelimiter); | ||
result += lineDelimiter; | ||
data.forEach(function (item) { | ||
ctr = 0; | ||
keys.forEach(function (key) { | ||
if (ctr > 0) { | ||
result += columnDelimiter; | ||
} | ||
var value = item[key]; | ||
if (typeof item[key] === 'string' && | ||
item[key].includes(columnDelimiter)) { | ||
value = "\"" + item[key] + "\""; | ||
} | ||
if (Array.isArray(item[key])) { | ||
value = "\"" + item[key].join(', ') + "\""; | ||
} | ||
result += value; | ||
ctr++; | ||
}); | ||
result += lineDelimiter; | ||
export var exportToCSV = function (data, columnDelimiter, lineDelimiter) { | ||
if (data === void 0) { data = []; } | ||
if (columnDelimiter === void 0) { columnDelimiter = ','; } | ||
if (lineDelimiter === void 0) { lineDelimiter = '\n'; } | ||
var result = ''; | ||
data.forEach(function (row) { | ||
result += row.join(columnDelimiter) + lineDelimiter; | ||
}); | ||
return result; | ||
}; |
import { exportToCSV } from './export-to-csv'; | ||
export default exportToCSV; | ||
export { exportToCSV }; |
import { exportToCSV } from './export-to-csv'; | ||
export default exportToCSV; | ||
export { exportToCSV }; |
@@ -1,2 +0,2 @@ | ||
import exportToCSV from './csv'; | ||
export { exportToCSV }; | ||
import DataExport from './data-export'; | ||
export { DataExport }; |
@@ -1,2 +0,2 @@ | ||
import exportToCSV from './csv'; | ||
export { exportToCSV }; | ||
import DataExport from './data-export'; | ||
export { DataExport }; |
{ | ||
"name": "@keen.io/data-export", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Keen data export utilities", | ||
@@ -25,2 +25,11 @@ "author": "Keen.IO <team@keen.io> (https://keen.io/)", | ||
}, | ||
"dependencies": { | ||
"@keen.io/charts-utils": "^1.13.0", | ||
"@keen.io/parser": "^2.8.97", | ||
"@keen.io/query": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"@keen.io/charts": "^2.33.0", | ||
"@keen.io/widgets": "^2.16.8" | ||
}, | ||
"bugs": { | ||
@@ -32,3 +41,3 @@ "url": "https://github.com/keen/keen/issues" | ||
}, | ||
"gitHead": "9447afaa5762a00bd25d8ad0a14820443c98666f" | ||
"gitHead": "1ceed93ad9e4fcc8bf89bb0ee117f867030ce580" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26879
62
509
3
2
1
+ Added@keen.io/parser@^2.8.97
+ Added@keen.io/query@^1.2.0
+ Added@keen.io/charts-utils@1.15.4(transitive)
+ Added@keen.io/colors@1.1.1(transitive)
+ Added@keen.io/parser@2.8.144(transitive)
+ Added@keen.io/query@1.2.2(transitive)
+ Added@keen.io/time-utils@1.3.0(transitive)
+ Added@types/d3-array@2.12.7(transitive)
+ Added@types/d3-format@1.4.5(transitive)
+ Added@types/d3-scale@2.2.10(transitive)
+ Added@types/d3-time@1.1.4(transitive)
+ Added@types/d3-time-format@2.3.4(transitive)
+ Addedd3-array@2.12.1(transitive)
+ Addedd3-color@2.0.0(transitive)
+ Addedd3-format@1.4.5(transitive)
+ Addedd3-interpolate@2.0.1(transitive)
+ Addedd3-scale@3.3.0(transitive)
+ Addedd3-time@1.1.02.1.1(transitive)
+ Addedd3-time-format@2.3.0(transitive)
+ Addeddayjs@1.11.13(transitive)
+ Addedinternmap@1.0.1(transitive)
+ Addednumeral@2.0.6(transitive)