Skip to content
Open

Dev #79

Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added anemui-core/assets/images/banner_logos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 27 additions & 7 deletions anemui-core/css/graphcontainer.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
div.GraphContainer {
@include bgFrame(12px);
position: absolute;

position: fixed;
left: 50%;
top: 30%;
transform: translate(-50%, -30%);
top: 50%;
transform: translate(-50%, -50%);
padding: 0.8em 1.5em;
background-color: rgba(255, 255, 255, 1);
background-color: rgba(255, 255, 255, 0.98);
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
z-index: 2000;
width: fit-content;
position: relative;
max-width: 90vw;
max-height: 85vh;
overflow: auto;
cursor: move;

// Responsive para pantallas pequeñas
@media (max-width: 768px) {
left: 5%;
top: 10%;
transform: none;
max-width: 90vw;
padding: 0.5em 1em;
}

@media (max-width: 480px) {
left: 2%;
top: 5%;
max-width: 96vw;
padding: 0.3em 0.5em;
}

a.popup-close-button {
position: absolute;
Expand Down Expand Up @@ -67,7 +86,8 @@ div.GraphContainer {

.dygraph-legend {
text-align: center;
width: 1024px;
width: 100% !important;
max-width: 100%;
background-color: transparent !important;
left: 0px !important;
}
Expand Down
1 change: 1 addition & 0 deletions anemui-core/css/topbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ input.selection-param-input {

.menu-checkbox {
padding: 0;
margin-left: 15px;
display: flex;
align-items: center;
gap: 8px;
Expand Down
3 changes: 2 additions & 1 deletion anemui-core/env/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports={
isTileDebugEnabled:false,
mapboxMapID:'b0rja/clo334xwq00jn01r28vwe1h6k',
mapboxAccessToken:'pk.eyJ1IjoiYjByamEiLCJhIjoiY2s5NjhvYjlkMGRsczNlbDQ3YXhvZTBvZyJ9.S3-_Wjl7BXcCLDOXNSbr_A',
logo:'logo_aemet.png',
// logo:'logo_aemet.png',
logo:'banner_logos.png',
initialZoom:6,
ncSignif:7,
dataSource: 'nc' // 'nc' or 'zarr'
Expand Down
4 changes: 2 additions & 2 deletions anemui-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lcsc/anemui-core",
"version": "0.2.2-SNAPSHOT",
"version": "0.2.3-SNAPSHOT",
"description": "Climatic Services Viewer Core",
"main": "./src/index.ts",
"types": "./src/index.ts",
Expand Down Expand Up @@ -82,6 +82,6 @@
"zarr": "^0.6.3"
},
"devDependencies": {
"@lcsc/anemui-test": ">=0.1.0-20250826"
"@lcsc/anemui-test": ">=0.2.3-202512180942"
}
}
20 changes: 16 additions & 4 deletions anemui-core/src/BaseApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ export abstract class BaseApp implements CsMapListener, MenuBarListener, DateFra
//TODO on change
let timeSpan = this.getTimeSpan(_timesJs.times[varId])
// let timeIndex = typeof _timesJs.times[varId] === 'string'? 0:_timesJs.times[varId].length - 1
let timeIndex = timeSpan == CsTimeSpan.Year? 0:_timesJs.times[varId].length - 1
let timeIndex = timeSpan == CsTimeSpan.Year? 0 : _timesJs.times[varId].length - 1
let legendTitle: string;
if (_timesJs.legendTitle[varId] != undefined) {
legendTitle = _timesJs.legendTitle[varId]
Expand Down Expand Up @@ -616,6 +616,7 @@ export abstract class BaseApp implements CsMapListener, MenuBarListener, DateFra
public getTimeSpan (time:string[]): CsTimeSpan {
if(typeof time === 'string') return CsTimeSpan.Year
let number
let yearCount = 1
if (time.length<=12) number = time.length
else {
const result = time.reduce((acc, curr) => {
Expand All @@ -625,15 +626,25 @@ export abstract class BaseApp implements CsMapListener, MenuBarListener, DateFra
}
return acc;
}, []);
yearCount = result.length
number = time.length / result.length;
}
// Caso especial: si hay exactamente 365 o 366 elementos totales, es día juliano
// independientemente de si las fechas cruzan dos años
if (time.length === 365 || time.length === 366) {
return CsTimeSpan.Day;
}

switch (number) {
case 1:
return CsTimeSpan.Year;
case 1:
return yearCount > 1 ? CsTimeSpan.YearSeries : CsTimeSpan.Year;
case 4:
return CsTimeSpan.Season;
case 12:
return CsTimeSpan.Month;
case 365:
case 366:
return CsTimeSpan.Day;
default:
return CsTimeSpan.Date;
}
Expand Down Expand Up @@ -697,6 +708,7 @@ export abstract class BaseApp implements CsMapListener, MenuBarListener, DateFra
// Continue with update even if there's an error
if (!dateChanged) this.dateSelectorFrame.update();
this.paletteFrame.update();
this.layerFrame.update();
this.changeUrl();
}
}
Expand Down Expand Up @@ -780,7 +792,7 @@ export abstract class BaseApp implements CsMapListener, MenuBarListener, DateFra
*/
protected isClimatologyCyclicMode(): boolean {
return this.state.climatology &&
(this.state.timeSpan === CsTimeSpan.Month || this.state.timeSpan === CsTimeSpan.Season);
(this.state.timeSpan === CsTimeSpan.Day || this.state.timeSpan === CsTimeSpan.Month || this.state.timeSpan === CsTimeSpan.Season);
}

public dateDateBack(): void {
Expand Down
1 change: 1 addition & 0 deletions anemui-core/src/Env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const hasClimatology:boolean = typeof ENV.hasClimatology !== 'undefined'?
export const logoStyle:string = typeof ENV.logoStyle !== 'undefined'? ENV.logoStyle:'longLogo';
export const maxPaletteValue = ENV.maxPaletteValue !== 'undefined'? ENV.maxPaletteValue:1000;
export const maxPaletteSteps = ENV.maxPaletteSteps !== 'undefined'? ENV.maxPaletteSteps:10;
export const globalMap = ENV.globalMap !== 'undefined'? ENV.globalMap:false;

// Factory Method Pattern
// true = usar factory method (permite override en subclases)
Expand Down
2 changes: 2 additions & 0 deletions anemui-core/src/LayerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class LayerManager {
private topLayerVector:Layer;
private topLayerImage:Image<ImageWMS>;
protected uncertaintyLayer: (Image<ImageStatic> | WebGLTile)[];
private uncertaintyLayerVisible: boolean = false;

private constructor() {
// CAPAS BASE
Expand Down Expand Up @@ -98,6 +99,7 @@ export class LayerManager {

this.topSelected="Límites estatales (mapbox)";
this.uncertaintyLayer = [];
this.uncertaintyLayerVisible = false;
}

// Base Layer
Expand Down
Loading