datastake-daf 0.6.293 β 0.6.295
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +15 -453
- package/dist/style/datastake/_index.css +2 -2
- package/dist/utils/index.js +9 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Globe/SimpleGlobe.jsx +40 -108
- package/src/@daf/core/components/Dashboard/Globe/SimpleGlobe.stories.js +0 -32
- package/src/@daf/core/components/EditForm/storyConfig.js +1 -1
- package/src/@daf/core/components/EditForm/storyConfig2.js +12945 -114
- package/src/constants/locales/en/translation.js +3 -0
- package/src/constants/locales/fr/translation.js +3 -0
- package/src/constants/locales/sp/translation.js +3 -0
- package/src/index.js +0 -2
- package/src/styles/datastake/_index.css +2 -2
- package/dist/style/datastake/mapbox-gl.css +0 -330
- package/src/@daf/core/components/Dashboard/Globe/CSSInJSGlobe.jsx +0 -415
- package/src/@daf/core/components/Dashboard/Globe/IsolatedGlobe.jsx +0 -345
- package/src/@daf/core/components/Dashboard/Globe/NoConflictGlobe.jsx +0 -488
- package/src/styles/datastake/mapbox-gl.css +0 -330
|
@@ -47,63 +47,16 @@ const SimpleGlobe = ({
|
|
|
47
47
|
// Set Mapbox access token
|
|
48
48
|
mapboxgl.accessToken = 'pk.eyJ1IjoicmVkaXM5OTkiLCJhIjoiY2x4YWV5MzA5MmtuZzJpcXM5Y201Z2E2YiJ9.m5bwPg-Tj4Akesl1yQUa3w';
|
|
49
49
|
|
|
50
|
-
// Create map with custom Straatos style
|
|
50
|
+
// Create map with custom Straatos style
|
|
51
51
|
map.current = new mapboxgl.Map({
|
|
52
52
|
container: mapContainer.current,
|
|
53
53
|
style: 'mapbox://styles/pietragottardo/cm9tt9zfi00d101pg1vdx26si',
|
|
54
54
|
center: [0, 0],
|
|
55
55
|
zoom: mapConfig.maxZoom || 3,
|
|
56
56
|
projection: 'globe',
|
|
57
|
-
// 3D globe settings for proper rendering
|
|
58
|
-
pitch: 0,
|
|
59
|
-
bearing: 0,
|
|
60
|
-
antialias: true,
|
|
61
|
-
fadeDuration: 0,
|
|
62
57
|
attributionControl: false
|
|
63
58
|
});
|
|
64
59
|
|
|
65
|
-
// Configure 3D globe when style loads
|
|
66
|
-
map.current.on('style.load', () => {
|
|
67
|
-
console.log('π¨ [SIMPLE GLOBE] Style loaded, configuring 3D globe...');
|
|
68
|
-
|
|
69
|
-
// Set fog for the space background effect with stars
|
|
70
|
-
try {
|
|
71
|
-
map.current.setFog({
|
|
72
|
-
'color': 'rgb(0, 0, 0)',
|
|
73
|
-
'high-color': 'rgb(0, 0, 0)',
|
|
74
|
-
'horizon-blend': 0.1,
|
|
75
|
-
'space-color': 'rgb(0, 0, 0)',
|
|
76
|
-
'star-intensity': 0.6
|
|
77
|
-
});
|
|
78
|
-
console.log('β¨ [SIMPLE GLOBE] Space background with stars set');
|
|
79
|
-
} catch (e) {
|
|
80
|
-
console.log('β οΈ [SIMPLE GLOBE] Could not set fog, trying alternative...');
|
|
81
|
-
// Fallback: try simpler fog configuration
|
|
82
|
-
try {
|
|
83
|
-
map.current.setFog({
|
|
84
|
-
'color': 'rgb(0, 0, 0)',
|
|
85
|
-
'high-color': 'rgb(0, 0, 0)',
|
|
86
|
-
'horizon-blend': 0.1
|
|
87
|
-
});
|
|
88
|
-
console.log('β¨ [SIMPLE GLOBE] Alternative space background set');
|
|
89
|
-
} catch (e2) {
|
|
90
|
-
console.log('β οΈ [SIMPLE GLOBE] Could not set any fog configuration');
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Set lighting for better 3D globe visibility
|
|
95
|
-
try {
|
|
96
|
-
map.current.setLight({
|
|
97
|
-
'anchor': 'viewport',
|
|
98
|
-
'color': 'white',
|
|
99
|
-
'intensity': 0.4
|
|
100
|
-
});
|
|
101
|
-
console.log('π‘ [SIMPLE GLOBE] Lighting configured for 3D globe');
|
|
102
|
-
} catch (e) {
|
|
103
|
-
console.log('β οΈ [SIMPLE GLOBE] Could not set lighting');
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
60
|
// Add markers when map loads
|
|
108
61
|
map.current.on('load', () => {
|
|
109
62
|
console.log('πΊοΈ [SIMPLE GLOBE] Map loaded, adding markers...');
|
|
@@ -124,42 +77,52 @@ const SimpleGlobe = ({
|
|
|
124
77
|
.mapboxgl-canvas {
|
|
125
78
|
overflow: hidden !important;
|
|
126
79
|
}
|
|
127
|
-
|
|
128
|
-
/* Namespace Mapbox styles to avoid Leaflet interference */
|
|
129
|
-
.daf-simple-globe-container .mapboxgl-marker {
|
|
130
|
-
position: absolute !important; /* let Mapbox control positioning */
|
|
131
|
-
transform: none !important; /* let Mapbox handle positioning for 3D globe */
|
|
132
|
-
left: auto !important;
|
|
133
|
-
top: auto !important;
|
|
134
|
-
z-index: 1000 !important; /* ensure markers are visible */
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.daf-simple-globe-container .mapboxgl-marker-pane {
|
|
138
|
-
position: absolute !important;
|
|
139
|
-
z-index: 1000 !important;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.daf-simple-globe-container .mapboxgl-canvas {
|
|
143
|
-
position: absolute !important;
|
|
144
|
-
top: 0;
|
|
145
|
-
left: 0;
|
|
146
|
-
}
|
|
147
|
-
|
|
80
|
+
/* CRITICAL: Override Leaflet CSS interference with Mapbox */
|
|
148
81
|
.daf-simple-globe-container .mapboxgl-canvas-container {
|
|
149
82
|
position: relative !important;
|
|
150
83
|
left: auto !important;
|
|
151
84
|
top: auto !important;
|
|
152
85
|
}
|
|
153
|
-
|
|
154
86
|
.daf-simple-globe-container .mapboxgl-canvas-container canvas {
|
|
155
|
-
position:
|
|
156
|
-
|
|
157
|
-
|
|
87
|
+
position: relative !important;
|
|
88
|
+
left: auto !important;
|
|
89
|
+
top: auto !important;
|
|
158
90
|
transform: none !important;
|
|
159
91
|
}
|
|
92
|
+
/* Prevent Leaflet styles from affecting Mapbox markers */
|
|
93
|
+
.daf-simple-globe-container .daf-globe-marker {
|
|
94
|
+
position: relative !important;
|
|
95
|
+
left: auto !important;
|
|
96
|
+
top: auto !important;
|
|
97
|
+
}
|
|
160
98
|
`;
|
|
161
99
|
document.head.appendChild(style);
|
|
162
100
|
|
|
101
|
+
// Set the space background with stars
|
|
102
|
+
try {
|
|
103
|
+
map.current.setFog({
|
|
104
|
+
'color': 'rgb(0, 0, 0)',
|
|
105
|
+
'high-color': 'rgb(0, 0, 0)',
|
|
106
|
+
'horizon-blend': 0.1,
|
|
107
|
+
'space-color': 'rgb(0, 0, 0)',
|
|
108
|
+
'star-intensity': 0.6
|
|
109
|
+
});
|
|
110
|
+
console.log('β¨ [SIMPLE GLOBE] Space background with stars set');
|
|
111
|
+
} catch (e) {
|
|
112
|
+
console.log('β οΈ [SIMPLE GLOBE] Could not set fog, trying alternative...');
|
|
113
|
+
// Fallback: try simpler fog configuration
|
|
114
|
+
try {
|
|
115
|
+
map.current.setFog({
|
|
116
|
+
'color': 'rgb(0, 0, 0)',
|
|
117
|
+
'high-color': 'rgb(0, 0, 0)',
|
|
118
|
+
'horizon-blend': 0.1
|
|
119
|
+
});
|
|
120
|
+
console.log('β¨ [SIMPLE GLOBE] Alternative space background set');
|
|
121
|
+
} catch (e2) {
|
|
122
|
+
console.log('β οΈ [SIMPLE GLOBE] Could not set any fog configuration');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
163
126
|
// Calculate bounds to fit all markers
|
|
164
127
|
const bounds = new mapboxgl.LngLatBounds();
|
|
165
128
|
let hasValidCoordinates = false;
|
|
@@ -258,32 +221,20 @@ const SimpleGlobe = ({
|
|
|
258
221
|
const lng = Number(project.longitude);
|
|
259
222
|
const lat = Number(project.latitude);
|
|
260
223
|
|
|
261
|
-
console.log(`π [SIMPLE GLOBE] Marker ${index} coordinates:`, {
|
|
262
|
-
lng,
|
|
263
|
-
lat,
|
|
264
|
-
project: project.name
|
|
265
|
-
});
|
|
224
|
+
console.log(`π [SIMPLE GLOBE] Marker ${index} coordinates:`, { lng, lat });
|
|
266
225
|
|
|
267
226
|
// Validate coordinates
|
|
268
227
|
if (isNaN(lng) || isNaN(lat) || lng < -180 || lng > 180 || lat < -90 || lat > 90) {
|
|
269
|
-
console.error(`β [SIMPLE GLOBE] Invalid coordinates for project ${index}:`, {
|
|
270
|
-
lng,
|
|
271
|
-
lat,
|
|
272
|
-
project: project.name
|
|
273
|
-
});
|
|
228
|
+
console.error(`β [SIMPLE GLOBE] Invalid coordinates for project ${index}:`, { lng, lat });
|
|
274
229
|
return;
|
|
275
230
|
}
|
|
276
|
-
console.log(`π Marker ${index} coordinates:`, { lng, lat });
|
|
277
231
|
|
|
278
232
|
// Add coordinates to bounds
|
|
279
233
|
bounds.extend([lng, lat]);
|
|
280
234
|
hasValidCoordinates = true;
|
|
281
235
|
|
|
282
|
-
//
|
|
283
|
-
const marker = new mapboxgl.Marker(
|
|
284
|
-
element: el,
|
|
285
|
-
anchor: 'center' // Use center anchor for 3D globe positioning
|
|
286
|
-
})
|
|
236
|
+
// Add marker to map with proper coordinate order [lng, lat]
|
|
237
|
+
const marker = new mapboxgl.Marker(el)
|
|
287
238
|
.setLngLat([lng, lat])
|
|
288
239
|
.setPopup(popup)
|
|
289
240
|
.addTo(map.current);
|
|
@@ -293,17 +244,6 @@ const SimpleGlobe = ({
|
|
|
293
244
|
console.log('π [SIMPLE GLOBE] Marker clicked:', project);
|
|
294
245
|
onProjectClick(project);
|
|
295
246
|
});
|
|
296
|
-
|
|
297
|
-
// Verify marker position after a short delay (like other Globe components)
|
|
298
|
-
setTimeout(() => {
|
|
299
|
-
const markerLngLat = marker.getLngLat();
|
|
300
|
-
console.log(`π [SIMPLE GLOBE] Marker ${index} position verification:`, {
|
|
301
|
-
expected: [lng, lat],
|
|
302
|
-
actual: [markerLngLat.lng, markerLngLat.lat],
|
|
303
|
-
project: project.name,
|
|
304
|
-
match: Math.abs(markerLngLat.lng - lng) < 0.0001 && Math.abs(markerLngLat.lat - lat) < 0.0001
|
|
305
|
-
});
|
|
306
|
-
}, 100);
|
|
307
247
|
|
|
308
248
|
console.log(`β
[SIMPLE GLOBE] Marker ${index} added at:`, [lng, lat]);
|
|
309
249
|
});
|
|
@@ -320,14 +260,6 @@ const SimpleGlobe = ({
|
|
|
320
260
|
} else {
|
|
321
261
|
boundsRef.current = null;
|
|
322
262
|
}
|
|
323
|
-
|
|
324
|
-
// Force resize for 3D globe rendering
|
|
325
|
-
setTimeout(() => {
|
|
326
|
-
if (map.current && map.current.resize) {
|
|
327
|
-
map.current.resize();
|
|
328
|
-
console.log('π [SIMPLE GLOBE] Map resized for 3D globe rendering');
|
|
329
|
-
}
|
|
330
|
-
}, 100);
|
|
331
263
|
});
|
|
332
264
|
|
|
333
265
|
return () => {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import SimpleGlobe from "./SimpleGlobe";
|
|
2
2
|
import SimpleGlobeDebug from "./SimpleGlobeDebug";
|
|
3
|
-
import NoConflictGlobe from "./NoConflictGlobe";
|
|
4
|
-
import CSSInJSGlobe from "./CSSInJSGlobe";
|
|
5
3
|
import ThemeLayout from "../../ThemeLayout";
|
|
6
4
|
import Widget from "../Widget";
|
|
7
5
|
|
|
@@ -284,33 +282,3 @@ export const DebugVersion = {
|
|
|
284
282
|
</div>
|
|
285
283
|
)
|
|
286
284
|
};
|
|
287
|
-
|
|
288
|
-
export const NoConflictVersion = {
|
|
289
|
-
name: "No Conflict Version (Aggressive CSS Isolation)",
|
|
290
|
-
render: () => (
|
|
291
|
-
<div style={{ margin: "3em" }}>
|
|
292
|
-
<ThemeLayout>
|
|
293
|
-
<Widget title="No Conflict Globe (Aggressive CSS Isolation)" className="no-px no-pb-body">
|
|
294
|
-
<div style={{ width: '100%', height: '600px' }}>
|
|
295
|
-
<NoConflictGlobe projects={SAMPLE_PROJECTS} type="location" color="#4ECDC4" />
|
|
296
|
-
</div>
|
|
297
|
-
</Widget>
|
|
298
|
-
</ThemeLayout>
|
|
299
|
-
</div>
|
|
300
|
-
)
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
export const CSSInJSVersion = {
|
|
304
|
-
name: "CSS-in-JS Version (No External CSS)",
|
|
305
|
-
render: () => (
|
|
306
|
-
<div style={{ margin: "3em" }}>
|
|
307
|
-
<ThemeLayout>
|
|
308
|
-
<Widget title="CSS-in-JS Globe (No External CSS)" className="no-px no-pb-body">
|
|
309
|
-
<div style={{ width: '100%', height: '600px' }}>
|
|
310
|
-
<CSSInJSGlobe projects={SAMPLE_PROJECTS} type="location" color="#4ECDC4" />
|
|
311
|
-
</div>
|
|
312
|
-
</Widget>
|
|
313
|
-
</ThemeLayout>
|
|
314
|
-
</div>
|
|
315
|
-
)
|
|
316
|
-
};
|