second commit

master
Титов Герман 3 years ago
parent af4409e8ac
commit 5cb77f42c2

@ -87,6 +87,11 @@ const initialFilterFilters = [
"label": "ГеоЭС", "label": "ГеоЭС",
"checked": false "checked": false
}, },
{
"value": 8,
"label": "СЭС и ВЭС",
"checked": false
},
{ {
"value": 7, "value": 7,
"label": "Все ВИЭ", "label": "Все ВИЭ",
@ -177,99 +182,105 @@ export default function Countries({ mapOptions, onMapOptionClick }) {
const generatePopup = (info) => { const generatePopup = (info) => {
console.log(info) console.log(info)
const [currentTech, currentYear, currentParameter] = filterFilters.map(f => f.options.find(o => o.checked)).concat(paintFilters[0].options.find(o => o.checked))
return ( return (
<div> <div>
<img src={`/flags/${info.id_country}.png`} className="mb-4 w-36" /> <img src={`/flags/${info.id_country}.jpg`} className="mb-4 w-36" />
{info.area_km2 && <p>Площадь {(info.area_km2 / 1000).toFixed(1).replace(".", ",")} тыс. км²</p>} {info.area_km2 && <p className="text-gray-500">Площадь <span className="text-gray-900 font-medium">{(info.area_km2 / 1000).toFixed(1).replace(".", ",")} тыс. км²</span></p>}
{info.population_person && <p>Численность населения {(info.population_person / 1000).toFixed(1).replace(".", ",")} тыс. чел.</p>} {info.population_person && <p className="text-gray-500">Численность населения <span className="text-gray-900 font-medium">{(info.population_person / 1000).toFixed(1).replace(".", ",")} тыс. чел.</span></p>}
{info.population_densitiy_pers_km2 && <p>Плотность населения {info.population_densitiy_pers_km2.toFixed(1).replace(".", ",")} чел./км²</p>} {info.population_densitiy_pers_km2 && <p className="text-gray-500">Плотность населения <span className="text-gray-900 font-medium">{info.population_densitiy_pers_km2.toFixed(1).replace(".", ",")} чел./км²</span></p>}
<div className="relative overflow-x-auto py-6"> {info.year_carbon_neutrality && <p className="text-gray-500">Целевой год достижения углеродной нейтральности <span className="text-gray-900 font-medium">{info.year_carbon_neutrality}</span></p>}
<p className="text-sm">{filterFilters.map(f => f.options.find(o => o.checked).label).join(". ")}</p>
{info[currentParameter.value] &&
<div className="relative overflow-x-auto py-6">
<p className="text-sm font-medium">{currentParameter.label} в {currentYear.label} году</p>
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody>
{info.power_fact_mw != null &&
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th scope="row" className="px-2 py-4 font-normal text-gray-900 dark:text-white">
{currentTech.label}
</th>
<td className="px-2 py-4">
{info[currentParameter.value].toFixed(1).replace(".", ",")}
</td>
</tr>
}
</tbody>
</table>
</div>
}
<div className="relative overflow-x-auto pt-2">
<p className="text-sm font-medium">Совокупная установленная мощность ВИЭ по итогам {info.static_date_power} года, МВт</p>
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400"> <table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
{/* <thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" className="px-2 py-3">
Показатель
</th>
<th scope="col" className="px-2 py-3">
Значение
</th>
</tr>
</thead> */}
<tbody> <tbody>
{info.power_fact_mw != null && {info.static_power_fact_solar_mw != null &&
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> <tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th scope="row" className="px-2 py-4 font-medium text-gray-900 dark:text-white"> <th scope="row" className="px-2 py-4 font-normal text-gray-900 dark:text-white">
Фактическая установленная мощность, МВт Солнечные электростанции
</th> </th>
<td className="px-2 py-4"> <td className="px-2 py-4">
{info.power_fact_mw.toFixed(2).replace(".", ",")} {info.static_power_fact_solar_mw.toFixed(1).replace(".", ",")}
</td> </td>
</tr> </tr>
} }
{info.power_plan_mw != null && {info.static_power_fact_onshore_mw != null &&
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> <tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th scope="row" className="px-2 py-4 font-medium text-gray-900 dark:text-white"> <th scope="row" className="px-2 py-4 font-normal text-gray-900 dark:text-white">
Плановая установленная мощность, МВт Наземные ветроэлектростанции
</th> </th>
<td className="px-2 py-4"> <td className="px-2 py-4">
{info.power_plan_mw.toFixed(1).replace(".", ",")} {info.static_power_fact_onshore_mw.toFixed(1).replace(".", ",")}
</td> </td>
</tr> </tr>
} }
{info.power_opw_mw != null && {info.static_power_fact_offshore_mw != null &&
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> <tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th scope="row" className="px-2 py-4 font-medium text-gray-900 dark:text-white"> <th scope="row" className="px-2 py-4 font-normal text-gray-900 dark:text-white">
Мощность отобранных проектов, МВт Офшорные ветроэлектростанции
</th> </th>
<td className="px-2 py-4"> <td className="px-2 py-4">
{info.power_opw_mw.toFixed(1).replace(".", ",")} {info.static_power_fact_offshore_mw.toFixed(1).replace(".", ",")}
</td> </td>
</tr> </tr>
} }
{info.capacity_additions_mw != null && {info.static_power_fact_res_mw != null &&
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> <tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th scope="row" className="px-2 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"> <th scope="row" className="px-2 py-4 font-medium text-gray-900 dark:text-white uppercase">
Годовой объём вводов, МВт Всего ВИЭ <span className="font-normal normal-case">(включая СЭС, ВЭС, ГЭС, БиоЭС, ГеоЭС)</span>
</th> </th>
<td className="px-2 py-4"> <td className="px-2 py-4">
{info.capacity_additions_mw.toFixed(1).replace(".", ",")} {info.static_power_fact_res_mw.toFixed(1).replace(".", ",")}
</td> </td>
</tr> </tr>
} }
{info.generation_gwh != null && {info.static_res_share_power != null &&
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> <tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th scope="row" className="px-2 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"> <th scope="row" className="px-2 py-4 font-normal text-gray-900 dark:text-white">
Производство электроэнергии, ГВтч Доля всей ВИЭ-генерации в балансе мощности страны, %
</th> </th>
<td className="px-2 py-4"> <td className="px-2 py-4">
{info.generation_gwh.toFixed(1).replace(".", ",")} {info.static_res_share_power.toFixed(1).replace(".", ",")}
</td> </td>
</tr> </tr>
} }
{info.res_share_generation != null && {info.static_solar_wind_share_power != null &&
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> <tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th scope="row" className="px-2 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"> <th scope="row" className="px-2 py-4 font-normal text-gray-900 dark:text-white">
Доля в выработке электроэнергии, % Доля СЭС и ВЭС в балансе мощности страны, %
</th> </th>
<td className="px-2 py-4"> <td className="px-2 py-4">
{info.res_share_generation.toFixed(1).replace(".", ",")} {info.static_solar_wind_share_power.toFixed(1).replace(".", ",")}
</td>
</tr>
}
{info.res_share_power != null &&
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th scope="row" className="px-2 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
Доля в балансе мощности, %
</th>
<td className="px-2 py-4">
{info.res_share_power.toFixed(1).replace(".", ",")}
</td> </td>
</tr> </tr>
} }
</tbody> </tbody>
</table> </table>
</div> </div>
<p className="text-sm text-gray-400">Источник: IRENA</p>
{info.date_actualization && <p className="text-sm mt-4 text-gray-600">Дата актуализации: {info.date_actualization}</p>} {info.date_actualization && <p className="text-sm mt-4 text-gray-600">Дата актуализации: {info.date_actualization}</p>}
</div> </div>
) )
@ -379,7 +390,7 @@ export default function Countries({ mapOptions, onMapOptionClick }) {
<div className="flex items-center"> <div className="flex items-center">
<Menu as="div" className="relative inline-block text-left"> <Menu as="div" className="relative inline-block text-left">
<div> <div>
<Menu.Button className="group inline-flex justify-center text-sm font-medium text-gray-700 hover:text-gray-900 outline outline-indigo-600 outline-offset-8 rounded-sm"> <Menu.Button className="group inline-flex justify-center text-sm font-medium text-gray-700 hover:text-gray-900">
{mapOptions.find((option) => option.current).name} {mapOptions.find((option) => option.current).name}
<ChevronDownIcon <ChevronDownIcon
className="-mr-1 ml-1 h-5 w-5 flex-shrink-0 text-gray-400 group-hover:text-gray-500" className="-mr-1 ml-1 h-5 w-5 flex-shrink-0 text-gray-400 group-hover:text-gray-500"
@ -530,12 +541,19 @@ export default function Countries({ mapOptions, onMapOptionClick }) {
defaultValue={option.value} defaultValue={option.value}
type="radio" type="radio"
defaultChecked={option.checked} defaultChecked={option.checked}
className="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500" className="peer h-4 w-4 rounded-full border-gray-400 text-indigo-600 focus:ring-indigo-500 disabled:text-gray-400 disabled:border-gray-200"
onChange={handleFilterToggle} onChange={handleFilterToggle}
disabled={
(paintFilters[0].options.find(o => o.checked).value == "res_share_generation" ||
paintFilters[0].options.find(o => o.checked).value == "res_share_power") &&
section.id == "id_tech" && option.value < 7 ?
true
: false
}
/> />
<label <label
htmlFor={`filter-${section.id}-${optionIdx}`} htmlFor={`filter-${section.id}-${optionIdx}`}
className="ml-3 text-sm text-gray-600" className="ml-3 text-sm text-gray-600 peer-disabled:text-gray-300"
> >
{option.label} {option.label}
</label> </label>

File diff suppressed because it is too large Load Diff

@ -173,7 +173,42 @@ const initialFilterFilters = [
"value": 2022, "value": 2022,
"label": 2022, "label": 2022,
"checked": true "checked": true
} },
{
"value": 2023,
"label": 2023,
"checked": false
},
{
"value": 2024,
"label": 2024,
"checked": false
},
{
"value": 2025,
"label": 2025,
"checked": false
},
{
"value": 2026,
"label": 2026,
"checked": false
},
{
"value": 2027,
"label": 2027,
"checked": false
},
{
"value": 2028,
"label": 2028,
"checked": false
},
{
"value": 2029,
"label": 2029,
"checked": false
},
] ]
} }
] ]
@ -205,7 +240,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) {
{info[currentParameter.value] && {info[currentParameter.value] &&
<div className="relative overflow-x-auto py-6"> <div className="relative overflow-x-auto py-6">
<p className="mb-2">{currentParameter.label} в {currentYear.label} году</p> <p className="text-sm font-medium">{currentParameter.label} в {currentYear.label} году</p>
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400"> <table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody> <tbody>
{info.power_fact_mw != null && {info.power_fact_mw != null &&
@ -224,7 +259,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) {
} }
<div className="relative overflow-x-auto py-6"> <div className="relative overflow-x-auto py-6">
<p className="mb-2">Совокупная установленная мощность ВИЭ по итогам {info.static_date_power} года, МВт</p> <p className="text-sm font-medium">Совокупная установленная мощность ВИЭ по итогам {info.static_date_power} года, МВт</p>
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400"> <table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody> <tbody>
{info.static_power_fact_solar_mw != null && {info.static_power_fact_solar_mw != null &&
@ -409,7 +444,7 @@ export default function Regions({ mapOptions, onMapOptionClick }) {
<div className="flex items-center"> <div className="flex items-center">
<Menu as="div" className="relative inline-block text-left"> <Menu as="div" className="relative inline-block text-left">
<div> <div>
<Menu.Button className="group inline-flex justify-center text-sm font-medium text-gray-700 hover:text-gray-900 outline outline-indigo-600 outline-offset-8 rounded-sm"> <Menu.Button className="group inline-flex justify-center text-sm font-medium text-gray-700 hover:text-gray-900">
{mapOptions.find((option) => option.current).name} {mapOptions.find((option) => option.current).name}
<ChevronDownIcon <ChevronDownIcon
className="-mr-1 ml-1 h-5 w-5 flex-shrink-0 text-gray-400 group-hover:text-gray-500" className="-mr-1 ml-1 h-5 w-5 flex-shrink-0 text-gray-400 group-hover:text-gray-500"
@ -560,12 +595,18 @@ export default function Regions({ mapOptions, onMapOptionClick }) {
defaultValue={option.value} defaultValue={option.value}
type="radio" type="radio"
defaultChecked={option.checked} defaultChecked={option.checked}
className="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500" className="peer h-4 w-4 rounded-full border-gray-400 text-indigo-600 focus:ring-indigo-500 disabled:text-gray-400 disabled:border-gray-200"
onChange={handleFilterToggle} onChange={handleFilterToggle}
disabled={
paintFilters[0].options.find(o => o.checked).value == "power_fact_mw" && section.id == "year" && option.value > 2022 ||
paintFilters[0].options.find(o => o.checked).value == "power_plan_mw" && section.id == "year" && option.value < 2022 ?
true
: false
}
/> />
<label <label
htmlFor={`filter-${section.id}-${optionIdx}`} htmlFor={`filter-${section.id}-${optionIdx}`}
className="ml-3 text-sm text-gray-600" className="ml-3 text-sm text-gray-600 peer-disabled:text-gray-300"
> >
{option.label} {option.label}
</label> </label>

@ -1,318 +0,0 @@
/*
This example requires some changes to your config:
```
// tailwind.config.js
module.exports = {
// ...
plugins: [
// ...
require('@tailwindcss/forms'),
],
}
```
*/
import { Fragment, useState } from 'react'
import { Dialog, Disclosure, Menu, Transition } from '@headlessui/react'
import { XMarkIcon } from '@heroicons/react/24/outline'
import { ChevronDownIcon, FunnelIcon, MinusIcon, PlusIcon, Squares2X2Icon } from '@heroicons/react/20/solid'
const sortOptions = [
{ name: 'Most Popular', href: '#', current: true },
{ name: 'Best Rating', href: '#', current: false },
{ name: 'Newest', href: '#', current: false },
{ name: 'Price: Low to High', href: '#', current: false },
{ name: 'Price: High to Low', href: '#', current: false },
]
const subCategories = [
{ name: 'Totes', href: '#' },
{ name: 'Backpacks', href: '#' },
{ name: 'Travel Bags', href: '#' },
{ name: 'Hip Bags', href: '#' },
{ name: 'Laptop Sleeves', href: '#' },
]
const filters = [
{
id: 'color',
name: 'Color',
options: [
{ value: 'white', label: 'White', checked: false },
{ value: 'beige', label: 'Beige', checked: false },
{ value: 'blue', label: 'Blue', checked: true },
{ value: 'brown', label: 'Brown', checked: false },
{ value: 'green', label: 'Green', checked: false },
{ value: 'purple', label: 'Purple', checked: false },
],
},
{
id: 'category',
name: 'Category',
options: [
{ value: 'new-arrivals', label: 'New Arrivals', checked: false },
{ value: 'sale', label: 'Sale', checked: false },
{ value: 'travel', label: 'Travel', checked: true },
{ value: 'organization', label: 'Organization', checked: false },
{ value: 'accessories', label: 'Accessories', checked: false },
],
},
{
id: 'size',
name: 'Size',
options: [
{ value: '2l', label: '2L', checked: false },
{ value: '6l', label: '6L', checked: false },
{ value: '12l', label: '12L', checked: false },
{ value: '18l', label: '18L', checked: false },
{ value: '20l', label: '20L', checked: false },
{ value: '40l', label: '40L', checked: true },
],
},
]
function classNames(...classes) {
return classes.filter(Boolean).join(' ')
}
export default function Example() {
const [mobileFiltersOpen, setMobileFiltersOpen] = useState(false)
return (
<div className="bg-white">
<div>
{/* Mobile filter dialog */}
<Transition.Root show={mobileFiltersOpen} as={Fragment}>
<Dialog as="div" className="relative z-40 lg:hidden" onClose={setMobileFiltersOpen}>
<Transition.Child
as={Fragment}
enter="transition-opacity ease-linear duration-300"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="transition-opacity ease-linear duration-300"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<div className="fixed inset-0 bg-black bg-opacity-25" />
</Transition.Child>
<div className="fixed inset-0 z-40 flex">
<Transition.Child
as={Fragment}
enter="transition ease-in-out duration-300 transform"
enterFrom="translate-x-full"
enterTo="translate-x-0"
leave="transition ease-in-out duration-300 transform"
leaveFrom="translate-x-0"
leaveTo="translate-x-full"
>
<Dialog.Panel className="relative ml-auto flex h-full w-full max-w-xs flex-col overflow-y-auto bg-white py-4 pb-12 shadow-xl">
<div className="flex items-center justify-between px-4">
<h2 className="text-lg font-medium text-gray-900">Filters</h2>
<button
type="button"
className="-mr-2 flex h-10 w-10 items-center justify-center rounded-md bg-white p-2 text-gray-400"
onClick={() => setMobileFiltersOpen(false)}
>
<span className="sr-only">Close menu</span>
<XMarkIcon className="h-6 w-6" aria-hidden="true" />
</button>
</div>
{/* Filters */}
<form className="mt-4 border-t border-gray-200">
<h3 className="sr-only">Categories</h3>
<ul role="list" className="px-2 py-3 font-medium text-gray-900">
{subCategories.map((category) => (
<li key={category.name}>
<a href={category.href} className="block px-2 py-3">
{category.name}
</a>
</li>
))}
</ul>
{filters.map((section) => (
<Disclosure as="div" key={section.id} className="border-t border-gray-200 px-4 py-6">
{({ open }) => (
<>
<h3 className="-mx-2 -my-3 flow-root">
<Disclosure.Button className="flex w-full items-center justify-between bg-white px-2 py-3 text-gray-400 hover:text-gray-500">
<span className="font-medium text-gray-900">{section.name}</span>
<span className="ml-6 flex items-center">
{open ? (
<MinusIcon className="h-5 w-5" aria-hidden="true" />
) : (
<PlusIcon className="h-5 w-5" aria-hidden="true" />
)}
</span>
</Disclosure.Button>
</h3>
<Disclosure.Panel className="pt-6">
<div className="space-y-6">
{section.options.map((option, optionIdx) => (
<div key={option.value} className="flex items-center">
<input
id={`filter-mobile-${section.id}-${optionIdx}`}
name={`${section.id}[]`}
defaultValue={option.value}
type="checkbox"
defaultChecked={option.checked}
className="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"
/>
<label
htmlFor={`filter-mobile-${section.id}-${optionIdx}`}
className="ml-3 min-w-0 flex-1 text-gray-500"
>
{option.label}
</label>
</div>
))}
</div>
</Disclosure.Panel>
</>
)}
</Disclosure>
))}
</form>
</Dialog.Panel>
</Transition.Child>
</div>
</Dialog>
</Transition.Root>
<main className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="flex items-baseline justify-between border-b border-gray-200 pt-24 pb-6">
<h1 className="text-4xl font-bold tracking-tight text-gray-900">New Arrivals</h1>
<div className="flex items-center">
<Menu as="div" className="relative inline-block text-left">
<div>
<Menu.Button className="group inline-flex justify-center text-sm font-medium text-gray-700 hover:text-gray-900">
Sort
<ChevronDownIcon
className="-mr-1 ml-1 h-5 w-5 flex-shrink-0 text-gray-400 group-hover:text-gray-500"
aria-hidden="true"
/>
</Menu.Button>
</div>
<Transition
as={Fragment}
enter="transition ease-out duration-100"
enterFrom="transform opacity-0 scale-95"
enterTo="transform opacity-100 scale-100"
leave="transition ease-in duration-75"
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
<Menu.Items className="absolute right-0 z-10 mt-2 w-40 origin-top-right rounded-md bg-white shadow-2xl ring-1 ring-black ring-opacity-5 focus:outline-none">
<div className="py-1">
{sortOptions.map((option) => (
<Menu.Item key={option.name}>
{({ active }) => (
<a
href={option.href}
className={classNames(
option.current ? 'font-medium text-gray-900' : 'text-gray-500',
active ? 'bg-gray-100' : '',
'block px-4 py-2 text-sm'
)}
>
{option.name}
</a>
)}
</Menu.Item>
))}
</div>
</Menu.Items>
</Transition>
</Menu>
<button type="button" className="-m-2 ml-5 p-2 text-gray-400 hover:text-gray-500 sm:ml-7">
<span className="sr-only">View grid</span>
<Squares2X2Icon className="h-5 w-5" aria-hidden="true" />
</button>
<button
type="button"
className="-m-2 ml-4 p-2 text-gray-400 hover:text-gray-500 sm:ml-6 lg:hidden"
onClick={() => setMobileFiltersOpen(true)}
>
<span className="sr-only">Filters</span>
<FunnelIcon className="h-5 w-5" aria-hidden="true" />
</button>
</div>
</div>
<section aria-labelledby="products-heading" className="pt-6 pb-24">
<h2 id="products-heading" className="sr-only">
Products
</h2>
<div className="grid grid-cols-1 gap-x-8 gap-y-10 lg:grid-cols-4">
{/* Filters */}
<form className="hidden lg:block">
<h3 className="sr-only">Categories</h3>
<ul role="list" className="space-y-4 border-b border-gray-200 pb-6 text-sm font-medium text-gray-900">
{subCategories.map((category) => (
<li key={category.name}>
<a href={category.href}>{category.name}</a>
</li>
))}
</ul>
{filters.map((section) => (
<Disclosure as="div" key={section.id} className="border-b border-gray-200 py-6">
{({ open }) => (
<>
<h3 className="-my-3 flow-root">
<Disclosure.Button className="flex w-full items-center justify-between bg-white py-3 text-sm text-gray-400 hover:text-gray-500">
<span className="font-medium text-gray-900">{section.name}</span>
<span className="ml-6 flex items-center">
{open ? (
<MinusIcon className="h-5 w-5" aria-hidden="true" />
) : (
<PlusIcon className="h-5 w-5" aria-hidden="true" />
)}
</span>
</Disclosure.Button>
</h3>
<Disclosure.Panel className="pt-6">
<div className="space-y-4">
{section.options.map((option, optionIdx) => (
<div key={option.value} className="flex items-center">
<input
id={`filter-${section.id}-${optionIdx}`}
name={`${section.id}[]`}
defaultValue={option.value}
type="checkbox"
defaultChecked={option.checked}
className="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"
/>
<label
htmlFor={`filter-${section.id}-${optionIdx}`}
className="ml-3 text-sm text-gray-600"
>
{option.label}
</label>
</div>
))}
</div>
</Disclosure.Panel>
</>
)}
</Disclosure>
))}
</form>
{/* Product grid */}
<div className="lg:col-span-3">
{/* Replace with your content */}
<div className="h-96 rounded-lg border-4 border-dashed border-gray-200 lg:h-full" />
{/* /End replace */}
</div>
</div>
</section>
</main>
</div>
</div>
)
}

@ -49,7 +49,13 @@
"source-layer": "countriesvalues", "source-layer": "countriesvalues",
"paint": { "paint": {
"fill-opacity": [ "fill-opacity": [
"case", ["has", "power_fact_mw"], 1, 0.1 "case",
[
"has",
"power_fact_mw"
],
1,
0.1
], ],
"fill-color": [ "fill-color": [
"step", "step",
@ -58,27 +64,27 @@
"power_fact_mw" "power_fact_mw"
], ],
"#440154", "#440154",
2763, 5000,
"#482173", "#482173",
9511, 19000,
"#433E85", "#433E85",
20641, 38000,
"#38598C", "#38598C",
37660, 70000,
"#2D708E", "#2D708E",
65308, 114000,
"#25858E", "#25858E",
92201, 155000,
"#1E9B8A", "#1E9B8A",
126103, 268000,
"#2BB07F", "#2BB07F",
162654, 385000,
"#51C56A", "#51C56A",
217397, 447000,
"#85D54A", "#85D54A",
290048, 580000,
"#C2DF23", "#C2DF23",
687382, 858000,
"#FDE725" "#FDE725"
] ]
} }
@ -90,26 +96,42 @@
"source-layer": "countriesvalues", "source-layer": "countriesvalues",
"paint": { "paint": {
"fill-opacity": [ "fill-opacity": [
"case", ["has", "power_plan_mw"], 1, 0.2 "case",
[
"has",
"power_plan_mw"
],
1,
0.1
], ],
"fill-color": [ "fill-color": [
"step", "step",
[ [
"get", "get",
"power_plan_mw" "power_fact_mw"
], ],
"#440154", "#440154",
17737, 5000,
"#443A83", "#482173",
62207, 19000,
"#31688E", "#433E85",
124767, 38000,
"#21908C", "#38598C",
224998, 70000,
"#35B779", "#2D708E",
377305, 114000,
"#8FD744", "#25858E",
720320, 155000,
"#1E9B8A",
268000,
"#2BB07F",
385000,
"#51C56A",
447000,
"#85D54A",
580000,
"#C2DF23",
858000,
"#FDE725" "#FDE725"
] ]
} }
@ -121,7 +143,13 @@
"source-layer": "countriesvalues", "source-layer": "countriesvalues",
"paint": { "paint": {
"fill-opacity": [ "fill-opacity": [
"case", ["has", "generation_gwh"], 1, 0.2 "case",
[
"has",
"generation_gwh"
],
1,
0.1
], ],
"fill-color": [ "fill-color": [
"step", "step",
@ -130,17 +158,27 @@
"generation_gwh" "generation_gwh"
], ],
"#440154", "#440154",
27216, 6000,
"#443A83", "#482173",
126167, 22000,
"#31688E", "#433E85",
320788, 48000,
"#21908C", "#38598C",
589439, 97000,
"#35B779", "#2D708E",
939268, 200000,
"#8FD744", "#25858E",
1666634, 340000,
"#1E9B8A",
580000,
"#2BB07F",
803000,
"#51C56A",
928000,
"#85D54A",
1178000,
"#C2DF23",
1710000,
"#FDE725" "#FDE725"
] ]
} }
@ -152,7 +190,13 @@
"source-layer": "countriesvalues", "source-layer": "countriesvalues",
"paint": { "paint": {
"fill-opacity": [ "fill-opacity": [
"case", ["has", "res_share_generation"], 1, 0.2 "case",
[
"has",
"res_share_generation"
],
1,
0.1
], ],
"fill-color": [ "fill-color": [
"step", "step",
@ -161,17 +205,27 @@
"res_share_generation" "res_share_generation"
], ],
"#440154", "#440154",
8, 2,
"#443A83", "#482173",
21, 6,
"#31688E", "#433E85",
36, 12,
"#21908C", "#38598C",
52, 19,
"#35B779", "#2D708E",
69, 27,
"#8FD744", "#25858E",
87, 37,
"#1E9B8A",
48,
"#2BB07F",
58,
"#51C56A",
70,
"#85D54A",
83,
"#C2DF23",
94,
"#FDE725" "#FDE725"
] ]
} }
@ -183,7 +237,13 @@
"source-layer": "countriesvalues", "source-layer": "countriesvalues",
"paint": { "paint": {
"fill-opacity": [ "fill-opacity": [
"case", ["has", "res_share_power"], 1, 0.2 "case",
[
"has",
"res_share_power"
],
1,
0.1
], ],
"fill-color": [ "fill-color": [
"step", "step",
@ -192,17 +252,27 @@
"res_share_power" "res_share_power"
], ],
"#440154", "#440154",
3,
"#482173",
9, 9,
"#443A83", "#433E85",
21, 15,
"#31688E", "#38598C",
36, 22,
"#21908C", "#2D708E",
51, 29,
"#35B779", "#25858E",
67, 38,
"#8FD744", "#1E9B8A",
86, 46,
"#2BB07F",
54,
"#51C56A",
64,
"#85D54A",
75,
"#C2DF23",
89,
"#FDE725" "#FDE725"
] ]
} }
@ -214,7 +284,13 @@
"source-layer": "countriesvalues", "source-layer": "countriesvalues",
"paint": { "paint": {
"fill-opacity": [ "fill-opacity": [
"case", ["has", "generation_to_population_kWh_pers"], 1, 0.2 "case",
[
"has",
"generation_to_population_kWh_pers"
],
1,
0.1
], ],
"fill-color": [ "fill-color": [
"step", "step",

Loading…
Cancel
Save