Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b4bf90a
chore: update deps to next and update arcade editor csss
omarkawach Apr 22, 2024
eb0340d
chore: update event names
omarkawach Apr 23, 2024
e117325
chore: update deps
omarkawach Apr 26, 2024
0bd3ad3
chore: update map-components amd and react template
omarkawach Apr 26, 2024
f497e8d
chore: add calcite comps react as dep
omarkawach Apr 26, 2024
fe5c5be
chore: remove calcite
omarkawach Apr 30, 2024
0fb31cc
chore: update angular zone js
omarkawach May 2, 2024
31ca1a1
chore: update to 4.30 and 2.8.0
omarkawach May 2, 2024
beb1945
chore: update deps
omarkawach May 2, 2024
a51423f
chore: update deps
omarkawach May 2, 2024
fd267e8
chore: update deps
omarkawach May 2, 2024
86d9994
chore: update READMEs
omarkawach May 2, 2024
d80e7d9
chore: update 4.30 stabilization version for dependencies
May 15, 2024
01051c7
docs: updated charts components templates
jimmyhchen May 27, 2024
6868532
docs: updated tutorial solution to match next dev site
jimmyhchen May 27, 2024
925baef
chore: updated scatterplot action bar locator
jimmyhchen Jun 3, 2024
91fadb0
Merge branch 'main' into next
jimmyhchen Jun 3, 2024
6bf38ed
chore: update deps
omarkawach Jun 4, 2024
32127aa
chore: change update script to use rc instead of next
omarkawach Jun 5, 2024
f68b3a4
chore: update syncpack
omarkawach Jun 5, 2024
40bddb0
chore: update dependencies
Jun 6, 2024
e028b2c
Revert "chore: update dependencies"
Jun 6, 2024
1926a21
chore: update dependencies
Jun 10, 2024
0c171ea
chore: update deps
omarkawach Jun 24, 2024
4077160
chore: remove update scripts
omarkawach Jun 26, 2024
f9f5e35
chore: remove download links
omarkawach Jun 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions .syncpackrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const config = {
dependencies: ["@arcgis/core"],
dependencyTypes: ["dev", "prod"],
packages: ["**"],
pinVersion: "~4.29.6"
pinVersion: "~4.30.0"
},
{
label: "ArcGIS Components dev and prod dependency",
Expand All @@ -64,27 +64,44 @@ const config = {
"@arcgis/map-components",
"@arcgis/map-components-angular",
"@arcgis/map-components-react",
],
packages: ["**"],
pinVersion: "~4.30.0"
},
{
label: "ArcGIS Charts Components dev and prod dependency",
dependencyTypes: ["dev", "prod"],
dependencies: [
"@arcgis/charts-components",
"@arcgis/charts-model",
"@arcgis/charts-components-angular",
"@arcgis/charts-components-react"
],
packages: ["**"],
pinVersion: "~4.29.6"
pinVersion: "~4.30.0"
},
{
label: "Calcite Components dev dependency",
dependencies: ["@esri/calcite-components"],
dependencies: [
"@esri/calcite-components",
"@esri/calcite-components-angular",
"@esri/calcite-components-react"
],
packages: ["**"],
dependencyTypes: ["dev", "prod"],
pinVersion: "^2.5.1"
pinVersion: "^2.8.5"
},
{
label: "React for dev and prod",
dependencyTypes: ["dev", "prod"],
dependencies: ["react", "react-dom"],
dependencies: [
"react",
"react-dom",
"@types/react-dom",
"@types/react"
],
packages: ["**"],
pinVersion: "^18.2.0"
pinVersion: "^18.3.0"
},
{
label: "Angular dev and prod deps",
Expand All @@ -103,7 +120,7 @@ const config = {
"@angular/compiler-cli"
],
packages: ["**"],
pinVersion: "^17.2.0"
pinVersion: "^17.3.6"
},
{
label: "Vite for dev",
Expand All @@ -117,14 +134,14 @@ const config = {
dependencyTypes: ["dev", "prod"],
dependencies: ["webpack"],
packages: ["**"],
pinVersion: "^5.90.1"
pinVersion: "^5.90.3"
},
{
label: "vue for dev, prod",
dependencyTypes: ["dev", "prod"],
dependencies: ["vue"],
packages: ["**"],
pinVersion: "^3.4.18"
pinVersion: "^3.4.19"
},
{
label: "css-loader for dev",
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
],
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"postinstall": "husky install",
"update": "yarn up @esri/calcite-components@next @arcgis/core@next @arcgis/map-components@next @arcgis/coding-components@next @arcgis/coding-components-react@next @arcgis/coding-components-angular@next"
"postinstall": "husky install"
},
"devDependencies": {
"@commitlint/cli": "18.6.1",
"@commitlint/config-conventional": "18.6.2",
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"husky": "9.0.11",
"prettier": "^3.0.0",
"syncpack": "^12.3.0"
Expand Down
2 changes: 0 additions & 2 deletions packages/charts-components/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

> **Disclaimer:** Components are in beta. Please do not contact Esri Technical Support for assistance.

📁 **[Click here to download all charts component templates as a ZIP file](https://download-directory.github.io?url=https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/tree/main/packages/charts-components/templates)** 📁

These templates and samples are for [@arcgis/charts-components](https://www.npmjs.com/package/@arcgis/charts-components)
10 changes: 1 addition & 9 deletions packages/charts-components/templates/amd-script-tag/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
# Charts components AMD template📁

📁 **[Click here to download this directory as a ZIP file](https://download-directory.github.io?url=https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/tree/main/packages/charts-components/templates/amd-script-tag)** 📁

## Resources

[ArcGIS Developers - Build with AMD modules](http://developers.arcgis.com/javascript/latest/amd-build/)

[Monaco - AMD editor sample](https://github.com/microsoft/monaco-editor/blob/main/samples/browser-amd-editor/index.html)
# Charts components AMD template
72 changes: 47 additions & 25 deletions packages/charts-components/templates/amd-script-tag/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,65 @@
<link rel="icon" href="data:;base64,=" />

<!-- Load the ArcGIS Maps SDK for JavaScript -->
<link rel="stylesheet" href="https://js.arcgis.com/4.29/esri/themes/dark/main.css" />
<script src="https://js.arcgis.com/4.29/"></script>
<link rel="stylesheet" href="https://js.arcgis.com/4.30/esri/themes/dark/main.css" />
<script src="https://js.arcgis.com/4.30/"></script>

<!-- Load the Charts Components -->
<script type="module" src="https://js.arcgis.com/charts-components/4.29/arcgis-charts-components.esm.js"></script>
<!-- TODO: Update to 4.30/js.arcgis.com after release -->
<script type="module" src="https://jsdev.arcgis.com/charts-components/next/arcgis-charts-components.esm.js"></script>

<!-- Load the Charts Model -->
<!-- TODO: Update to 4.30/js.arcgis.com after release -->
<script type="module" src="https://jsdev.arcgis.com/charts-model/next/index.js"></script>
</head>

<body>
<arcgis-charts-scatter-plot id="scatter-plot" class="chart-container"></arcgis-charts-scatter-plot>
<script>
<arcgis-charts-scatter-plot id="scatterplot" class="chart-container"></arcgis-charts-scatter-plot>
<script type="module">
/**
* Import ScatterPlotModel from the Charts Model module.
*/
const { ScatterPlotModel } = await $arcgis.import("@arcgis/charts-model");

/**
* Simple data loader against public data.
* For the test data, we need a feature layer.
* Create a feature layer with a service URL. This will be used to create a chart later.
*/
async function loadFeatureLayerItem() {
const WebMap = await $arcgis.import("esri/WebMap");
const webmap = new WebMap({
portalItem: {
id: "a72bb6468f57491f84409186446808e1"
}
async function createFeatureLayer(url) {
const FeatureLayer = await $arcgis.import("esri/layers/FeatureLayer");

const featureLayer = new FeatureLayer({
url: url
});
await webmap.loadAll();
const featureLayerItem = webmap.layers.items[0];

return featureLayerItem;
await featureLayer.load();

return featureLayer;
}

/**
* Listen for the `arcgisChartsUpdateComplete` event to update the chart with the feature layer.
* Initialize the scatterplot chart.
*/
document.querySelector("arcgis-charts-scatter-plot").addEventListener("arcgisChartsUpdateComplete", async (event) => {
const layer = await loadFeatureLayerItem();
const config = layer.charts[0];
const scatterPlot = document.getElementById("scatter-plot");

scatterPlot.config = config;
scatterPlot.layer = layer;
});
async function initScatterplot() {
const layer = await createFeatureLayer('https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/ChicagoCr/FeatureServer/0');

const scatterplotElement = document.getElementById("scatterplot");

// Create a new ScatterPlotModel and set the x and y axis fields.
const scatterplotModel = new ScatterPlotModel();
await scatterplotModel.setup({ layer });

await scatterplotModel.setXAxisField("Ward");
await scatterplotModel.setYAxisField("Beat");

// Set the scatterplot element's config and layer properties.
const config = scatterplotModel.getConfig();

scatterplotElement.config = config;
scatterplotElement.layer = layer;
}

// Call initScatterplot() function to render the chart.
initScatterplot();
</script>
</body>

Expand Down
4 changes: 1 addition & 3 deletions packages/charts-components/templates/angular/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# Charts components Angular template

📁 **[Click here to download this directory as a ZIP file](https://download-directory.github.io?url=https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta/tree/main/packages/charts-components/templates/angular)** 📁
# Charts components Angular template
34 changes: 17 additions & 17 deletions packages/charts-components/templates/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@
"test": "ng test"
},
"dependencies": {
"@angular/animations": "^17.2.0",
"@angular/common": "^17.2.0",
"@angular/compiler": "^17.2.0",
"@angular/core": "^17.2.0",
"@angular/forms": "^17.2.0",
"@angular/platform-browser": "^17.2.0",
"@angular/platform-browser-dynamic": "^17.2.0",
"@angular/router": "^17.2.0",
"@arcgis/charts-components-angular": "~4.29.6",
"@arcgis/charts-model": "~4.29.6",
"@arcgis/core": "~4.29.6",
"@esri/calcite-components": "^2.5.1",
"@angular/animations": "^17.3.6",
"@angular/common": "^17.3.6",
"@angular/compiler": "^17.3.6",
"@angular/core": "^17.3.6",
"@angular/forms": "^17.3.6",
"@angular/platform-browser": "^17.3.6",
"@angular/platform-browser-dynamic": "^17.3.6",
"@angular/router": "^17.3.6",
"@arcgis/charts-components-angular": "~4.30.0",
"@arcgis/charts-model": "~4.30.0",
"@arcgis/core": "~4.30.0",
"@esri/calcite-components": "^2.8.5",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
"zone.js": "~0.14.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.2.0",
"@angular/cli": "^17.2.0",
"@angular/compiler-cli": "^17.2.0",
"@angular-devkit/build-angular": "^17.3.6",
"@angular/cli": "^17.3.6",
"@angular/compiler-cli": "^17.3.6",
"@types/jasmine": "~5.1.0",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.3.2"
"typescript": "~5.4.5"
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<arcgis-charts-scatter-plot #scatterPlot class="chart-component"></arcgis-charts-scatter-plot>
<arcgis-charts-scatter-plot #scatterplot class="chart-component"></arcgis-charts-scatter-plot>
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,52 @@
* limitations under the License.
*/

import { Component, ViewChild } from '@angular/core';
import { loadFeatureLayer } from '../functions/load-data.service';
import { ScatterPlotModel } from '@arcgis/charts-model';
import { Component, ViewChild } from "@angular/core";
import { createFeatureLayer } from "../functions/create-feature-layer.service";
import { ScatterPlotModel } from "@arcgis/charts-model";

import { defineCustomElements as defineChartsElements } from '@arcgis/charts-components/dist/loader';
import { defineCustomElements as defineChartsElements } from "@arcgis/charts-components/dist/loader";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrl: './app.component.css',
selector: "app-root",
templateUrl: "./app.component.html",
styleUrl: "./app.component.css"
})
export class AppComponent {
title = 'charts-components-angular-template';
title = "charts-components-angular-template";

@ViewChild('scatterPlot') scatterPlot: HTMLArcgisChartsScatterPlotElement | undefined;
@ViewChild("scatterplot") scatterplot: HTMLArcgisChartsScatterPlotElement | undefined;

ngOnInit() {
// define custom elements in the browser, and load the assets from the CDN
defineChartsElements(window, { resourcesUrl: 'https://js.arcgis.com/charts-components/4.29/t9n' });
defineChartsElements(window, { resourcesUrl: "https://js.arcgis.com/charts-components/4.30/t9n" });
}

// Call async functions here
this.createScatterPlot();
ngAfterViewInit() {
this.initScatterplot();
}

// Async function to create a scatter plot
async createScatterPlot() {
const featureLayer = await loadFeatureLayer('8871626e970a4f3e9d6113ec63a92f2f');
/**
* Function to initialize the scatterplot.
*/
async initScatterplot() {
const layer = await createFeatureLayer(
"https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/ChicagoCr/FeatureServer/0"
);

const scatterPlotParams = {
layer: featureLayer,
xAxisFieldName: 'Earnings',
yAxisFieldName: 'Cost',
};
// Create a new ScatterPlotModel and set the x and y axis fields.
const scatterplotModel = new ScatterPlotModel();
await scatterplotModel.setup({ layer });

const scatterPlotModel = new ScatterPlotModel(scatterPlotParams);
await scatterplotModel.setXAxisField("Ward");
await scatterplotModel.setYAxisField("Beat");

const config = await scatterPlotModel.config;
// Set the scatterplot element's config and layer properties.
const config = scatterplotModel.getConfig();

if (this.scatterPlot !== undefined) {
this.scatterPlot.config = config;
this.scatterPlot.layer = featureLayer;
if (this.scatterplot !== undefined) {
this.scatterplot.config = config;
this.scatterplot.layer = layer;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@
import FeatureLayer from "@arcgis/core/layers/FeatureLayer";

/**
* Simple data loader against public data.
* For the test data, we need a feature layer.
* Create a feature layer with a service URL. This will be used to create a chart later.
*/
export async function loadFeatureLayer(portalItemId) {
export async function createFeatureLayer(url: string): Promise<any> {
const featureLayer = new FeatureLayer({
portalItem: {
id: portalItemId
}
url: url
});

await featureLayer.load();
Expand Down
Loading